通过使用Microsoft Dynamics CRM中的插件,将数字值添加到帐户实体的销售代表属性中
|
之后,我在类库中编写了代码,然后构建了代码并将代码复制到
C:\\Program Files\\Microsoft Dynamics CRM\\Server\\bin\\assembly
我试图模拟工作。它没有填充表单中的值。
谁能帮我解决这个问题?
public void Execute(IPluginExecutionContext context)
{
DynamicEntity entity = null;
if (context.InputParameters.Properties.Contains(\"Target\") &&
context.InputParameters.Properties[\"Target\"] is DynamicEntity)
{
entity = (DynamicEntity)context.InputParameters.Properties[\"Target\"];
if (entity.Name != EntityName.account.ToString()) { return; }
}
else
{
return;
}
try
{
// DynamicEntity followup = new DynamicEntity();
CrmNumber gcs_numb = new CrmNumber();
gcs_numb.Value = 10;
//follow.Properties = new PropertyCollection();
entity.Properties.Add(new CrmNumberProperty(\"gcs_numberofsalesreps\", gcs_numb));
}
catch (System.Web.Services.Protocols.SoapException ex)
{
throw new InvalidPluginExecutionException(
\"An error occurred in the Account plug-in.\", ex);
}
}
没有找到相关结果
已邀请:
1 个回复
破弯
您是否创建了自定义字段并正确发布了它们? * gcs_numberofsalesreps *必须作为帐户实体上的有效数字字段存在。