タスクを作成するCRMのカスタムワークフローアクティビティ
-
05-07-2019 - |
質問
タスクを作成するカスタムワークフローアクティビティをCRMで作成しました。ワークフローは機会に添付されます。タスクを作成するときに、“ regardingobjectid”を設定します。関連する機会のガイドへ。
ICrmService crmService = context.CreateCrmService();
task entity = new task();
entity.subject = taskSubject;
entity.regardingobjectid.Value = ??????
crmService.Create(entity);
これは可能ですか?簡単だと思った。
解決
アクティビティの最初の数行が次のようになっていると仮定します:
IContextService contextService = (IContextService)executionContext.GetService(typeof(IContextService));
IWorkflowContext context = contextService.Context;
これを行うことができるはずです:
entity.regardingobjectid = new Lookup("opportunity", context.PrimaryEntityId);
所属していません StackOverflow