07-13-2010 10:53 AM
I'm using ACT Version 22.214.171.1241
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?
07-13-2010 11:26 AM - edited 07-13-2010 11:35 AM
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;