Community
Showing results for 
Search instead for 
Do you mean 
Reply

How do you change the value of a bit field using the SDK?

Avid Listener
Posts: 9
Country: United States

How do you change the value of a bit field using the SDK?

I'm using ACT Version 12.0.0.401

 

I'm writing in vb.net (a visual studio 2005 app)

 

Several new opportunity fields have been created using the "define fields" wizard within Act.

The fields created were the field data type "Yes/No"

The fields appear to be Bit fields in the database.

 

Can this field's value be changed using somethibng like this in the code:

 

opp.Fields.Item("TBL_OPPORTUNITY.CUST_somefield_113533042", True) = new_value

 

where new_value is a memory variable?

Employee
Posts: 1,163
Country: USA

Re: How do you change the value of a bit field using the SDK?

[ Edited ]

Yes, it can be done this way, but limitation you'll notice is that although we're altering the value of the field, because we're only in the framework the UI isn't aware that the change has been made so you'll want to refresh/update.

 

Also, if you capture the YesNo field as a fielddescriptor then you can call the get/set value methods instead of assigning a value to the field. Here's an example, apologies for it being in c#, but that's what I do everything in, if you have trouble translating let me know and I'll see if I can do it for you.

 

ContactFieldDescriptor YesNoContactField = ActApp.ActFramework.Contacts.GetContactFieldDescriptor("TBL_CONTACT.CUST_YesandNo_020852428");
                Contact contact = ActApp.ApplicationState.CurrentContact;
                YesNoContactField.SetValue(contact, true);
                contact.Update();

Matthew Wood
Act! SDK Support
Community Moderator