0
我需要爲Dynamics CRM Online創建插件,在編輯聯繫人字段後隨機更改公司名稱。 因爲我知道我需要更改parentcustomerid字段,但我不知道如何獲取所有客戶ID,並將其中的一個分配給插件的代碼。Dynamics CRM中更換公司的插件
我的代碼:
public class ContactPlugin: IPlugin
{
public void Execute(IServiceProvider serviceProvider)
{
IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
if (context.InputParameters.Contains("Target") &&
context.InputParameters["Target"] is Entity)
{
Entity entity = (Entity)context.InputParameters["Target"];
if (entity.LogicalName == "contact")
{
//entity.Attributes.Add("parentcustomerid", GetNewParentCustomerId());
}
}
}
}
我怎樣才能做到這一點?
感謝您的幫助,我做了我想要的。 – AlxZahar