Am trying to update child contacts based on a "Two Options" field in the account form. I update all child contacts to the updated address of parent account if the "Two Option" field is set to "Yes". I try to retrieve the value using the following code,
bool? updateContactsValue
= entity.GetAttributeValue<bool?>("abc_yesNoField");
if (updateContactsValue)
{
String[] details = new string[7];
String telephoneNum = String.Empty, ... , country = String.Empty;
telephoneNum = entity.GetAttributeValue<String>("telephone1");
details[0] = telephoneNum;
...
UpdateContact(service, entity.Id, details);
}
But i find that the address fields are not being updated even if the selected option is "Yes". Am i missing something here?
Hi all, I have modified the code to as follows
bool? updateContactsValue=null;
updateContactsValue = entity.GetAttributeValue<bool?> ("abc_yesNoField").GetValueOrDefault();
throw new Exception( "My custom Exception"+" "+entity.GetAttributeValue<bool?>("abc_yesNoField").GetValueOrDefault().ToString());
The system throws "false" even if I had chosen "Yes".