Hello,
I have one particular custom field I created on CRM that I could not retrieve by ColumnSet. I read that a column could not be retrieved if it had null values. Is there a workaround to retrieve all the custom values on CRM including those fields that have null values?
Here is the portion of the code where I tried in order to retrieve the custom field "new_PrimaryContacthasEmail". I am using early bound:
// Retrieve record of primary contact
Guid primaryContactId = retrievedAccount.PrimaryContactId.Id;
ColumnSet contactCols = new ColumnSet(true);
Contact retrievedContact = (Contact)service.Retrieve("contact", primaryContactId, contactCols);
try
{
if (retrievedContact.EMailAddress1.CompareTo(string.Empty) == 0)
{
retrievedIncident.new_PrimaryContacthasEmail = false;
}
else
{
retrievedIncident.new_PrimaryContacthasEmail = true;
}
service.Update(retrievedIncident);
}
catch (Exception e)
{
Console.WriteLine("An error occurred: '{0}'", e);
}
*This post is locked for comments
I have the same question (0)