I created a custom CRM activity that I use in my workflow. I use this action as an InArgument for a custom workflow action. In the Execute () method, I try to set the OwnerId of the user CRM activity instance to the system user and call the UpdateObject object in the context object that I created using CrmSvcUtil.
[Input("Some name")] [ReferenceEntity("mycustomactivity")] [Required] public InArgument<EntityReference> MyCustomActivity{get;set;} void Execute(CodeActivityContext context) { IOrganizationService svc = context.GetExtension<IOrganizationService>(); var customActivityReference = MyCustomActivity.GetValue(MyCustomActivity);
The above does not work, the default activity owner runs the crm user account and is not updated to reflect the owner I set in activityInstance.OwnerId
Any help would be greatly appreciated.
source share