문제

작업을 만드는 CRM에서 사용자 정의 워크 플로 활동을 만들었습니다. 워크 플로는 기회에 연결되어 있습니다. 작업을 만들 때 관련 기회의 안내에“AnboutObjectid”를 설정하고 싶습니다.

        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);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top