我尝试设置我的选择列表中选择的值,同时增加了新的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'属性应该填充与所需选项列表项目的选项列表值相对应的整数。 –