我嘗試設置我的選擇列表中選擇的值,同時增加了新的account.My代碼:如何在crm 4.0上設置特定的選項列表值?
CrmService service = connectToCrm();
PropertyCollection Prop = new PropertyCollection();
DynamicEntity Firma = new DynamicEntity();
// set table
Firma.Name = EntityName.account.ToString();
StringProperty accountName = new StringProperty();
accountName.Name = "name";
accountName.Value = aDict["name"].ToString();
Prop.Add(accountName);
StringProperty vendorCode = new StringProperty();
vendorCode.Name = "new_bayikodu";
vendorCode.Value = aDict["new_bayikodu"].ToString();
Prop.Add(vendorCode);
StringProperty VD = new StringProperty();
VD.Name = "new_taxoffice";
VD.Value = aDict["new_taxoffice"].ToString();
Prop.Add(VD);
StringProperty VN = new StringProperty();
VN.Name = "accountnumber";
VN.Value = aDict["accountnumber"].ToString();
Prop.Add(VN);
StringProperty address = new StringProperty();
address.Name = "address1_line1";
address.Value = aDict["address1_line1"].ToString();
Prop.Add(address);
StringProperty tel = new StringProperty();
tel.Name = "telephone1";
tel.Value = aDict["telephone1"].ToString();
Prop.Add(tel);
StringProperty accountEmail = new StringProperty();
accountEmail.Name = "emailaddress1";
accountEmail.Value = aDict["emailaddress1"].ToString();
Prop.Add(accountEmail);
Firma.Properties = Prop;
Guid CustomerGuid = service.Create(Firma);
例子我想設置城市選擇列表爲「伊斯坦布爾」 我可以使用picklistproperty?
這似乎在City.Name = 23(無法將int值分配給選取列表中)中無效。 –
當然,它不起作用。 'Name'屬性應該以實體屬性名稱作爲字符串填充。例如。 city.Name =「new_mycustomattribute」。 'Value'屬性應該填充與所需選項列表項目的選項列表值相對應的整數。 –