2016-01-06 35 views
1

我不知道如何更新像全稱複合材料領域,在MS CRM地址使用C#更新複合材料領域,如全名,地址

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

//it is not getting fullname in entity 
+0

如果您還有其他疑問,請使用「提問」按鈕,而不是編輯你當前的帖子來詢問別的東西。 – josliber

回答

4

不能直接設置複合字段的值。您需要設置基礎字段(例如,設置firstnamelastname將更改聯繫人中的fullname的值)。

從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.

+0

爲此,我們必須硬編碼來識別和處理複合字段。 。有沒有什麼動態的方式來做到這一點 – Ajit004

+0

我不是很追隨你。在上面的例子中,你已經硬編碼了字符串「fullname」。隨時提出一個新的問題,你詳細說明你的具體情況。 –

+0

答覆Henrik。我剛剛更新了這個問題。 。 plz通過它。 – Ajit004