Ajit004
Ajit004

Reputation: 75

Update composite fields like fullname,address

i dont know how to update the composite fields like fullname,address in ms crm using c#

if (dataRow[i].ToString() == string.Empty)
{
    selectedEntity["fullname"] = null;
}
else
{
    selectedEntity["fullname"] = "ms crm";
    //error
}

//it is not getting fullname in entity

Upvotes: 1

Views: 1158

Answers (1)

Henrik H
Henrik H

Reputation: 5787

You cannot set the values of composite fields directly. You will need to set the underlying fields instead (e.g. setting firstname and lastname will change the value of fullname in a Contact).

The following quote from MSDN explains this (though in the context of scripting on forms):

Although you can read the value of the composite value using getValue, you can’t use setValue to change the value of the composite attribute directly; you must set one or more of the attributes referenced by the composite attribute.

Upvotes: 4

Related Questions