How to call Global action using Console application

 We can Global action in any place

Ex. This we can execute using Js or we can call this using a console application or we can call this action using plug in. Here it will take input arguments(if you specify in your action) and returns output variable.

Action will not execute in below conditions

  • When the action is in Draft state
  • When the action is profiled

Hence, once you move or import the solution to the higher instance make sure all the Process will be in Active state.

Enough of explanation....

Now Below piece of code to call entity specific action.

for establishing the connection in console you can refer this URL

The difference between Entity specific action and global action is, for entity specific action we should add Target attribute where global action it's not required. If you are not specify the Target attribute for entity specific action it will give error(Error: Target attribute is required)

Defining global action:

Below are two Input attributes:

  • EntityName(Type:string)
  • RegardingObjectId(Type:string)

 OrganizationRequest req = new OrganizationRequest("YOUR GLOBAL ACTION NAME");

            req.Parameters.Add(new KeyValuePair<string, object>("EntityName", "contact"));

            req.Parameters.Add(new KeyValuePair<string, object>("RegardingObjectId", "Sample 1");

            OrganizationResponse Response= organizationService.Execute(req);

Comments

Popular posts from this blog

Connecting Dynamics 365 Web api using external HTML page

Get azure blob files inside Sub Directories

Interview questions on MS CRM