gpt4 book ai didi

c# - Microsoft Dynamics CRM 工作流教程不起作用

转载 作者:太空宇宙 更新时间:2023-11-03 22:43:29 25 4
gpt4 key购买 nike

我正在尝试按照教程进行操作: https://msdn.microsoft.com/en-us/library/gg509012.aspx

但是,当我到达线路时:

protected override void Execute(CodeActivityContext executionContext)
{
IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>();

//Create an Organization Service
IOrganizationServiceFactory serviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>();
IOrganizationService service = serviceFactory.CreateOrganizationService(context.InitiatingUserId);

//Retrieve the contact id
Guid contactId = this.Contact.Get(executionContext).Id;
}

它在 C# 中给出错误。

C# 'Program' does not contain a definition for 'Contact' and no extension method 'Contact' accepting a first argument of type 'Program' could be found are you missing a using directive or an assembly reference?

什么是this.Contact

最佳答案

Contact 是自定义事件工作流的 in 参数

//Define the properties
[RequiredArgument]
[Input("Update Next Birthdate for")]
[ReferenceTarget("contact")]

public InArgument<EntityReference> Contact { get; set; }

protected override void Execute(CodeActivityContext executionContext)
{
IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>();

//Create an Organization Service
IOrganizationServiceFactory serviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>();
IOrganizationService service = serviceFactory.CreateOrganizationService(context.InitiatingUserId);

//Retrieve the contact id
Guid contactId = this.Contact.Get(executionContext).Id;
}

当您从工作流或操作调用自定义时,您必须发送所需的输入参数,例如联系人。

关于c# - Microsoft Dynamics CRM 工作流教程不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51046281/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com