Hi,
Currently I need help for Workflow Activity. Please take a look at code below:
protected override void Execute(CodeActivityContext executionContext) { // Create the tracing service ITracingService tracingService = executionContext.GetExtension<ITracingService>(); if (tracingService == null) { throw new NullReferenceException("Failed to retrieve tracing service."); } tracingService.Trace("Entered ProposeCaseActivity.Execute(), Activity Instance Id: {0}, Workflow Instance Id: {1}", executionContext.ActivityInstanceId, executionContext.WorkflowInstanceId); // Create the context IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>(); if (context == null) { throw new NullReferenceException("Failed to retrieve workflow context."); } tracingService.Trace("ProposeCaseActivity.Execute(), Correlation Id: {0}, Initiating User: {1}", context.CorrelationId, context.InitiatingUserId); IOrganizationServiceFactory serviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>(); IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId); CrmServiceContext serviceContext = new CrmServiceContext(service); }
Why do the tracing service and also the workflow context are null? What is happening? Doesn't it the default code for a Dynamics Workflow Activity?
Thanks in advance.
Do you got an answer to this question?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156