更新完整名称,地址等复合字段

时间:2016-01-06 07:33:18

标签: dynamics-crm-2011 dynamics-crm crm

我不知道如何使用c#

更新ms crm中的全名,地址等复合字段
if (dataRow[i].ToString() == string.Empty)
{
    selectedEntity["fullname"] = null;
}
else
{
    selectedEntity["fullname"] = "ms crm";
    //error
}

//it is not getting fullname in entity

1 个答案:

答案 0 :(得分:4)

您无法直接设置复合字段的值。您需要设置基础字段(例如设置ObjectAfirstname将更改联系人中lastname的值。

MSDN的以下引用解释了这一点(尽管在表单脚本的上下文中):

  

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.