Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Run a workflow as Admin within a plugin

$
0
0

Hi,

In a plugin we trigger a workflow(action).

This action should be executed with admin account.

Untill recently, this worked by passing null in the organization service.

Currently, it returns the wrong result: I suspect it runs no longer as admin and the initiating user does not have the necessary permissions.

I suspect it might have started with UR2 update on our on-prem 2016 env.

Code we use:

OrganizationRequest request = new OrganizationRequest("fua_adminservice");
                        request["Parameters"] = input.ToJson();

var adminOrganizationService = serviceFactory.CreateOrganizationService(null);

OrganizationResponse response = adminOrganizationService.Execute(request);

Is this still the correct way?

I know we made changes in javascript to execute as an admin.


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images