Dynamics 365 API function “Xrm.Utility.invokeProcessAction” to trigger Global Action

Dynamics 365 is a metadata-driven application which we sometimes need to create an Action to be executed on multiple entities. This way, we can use Global Action regarding Dynamics 365 API.

Explaining Action

Actions are a form of process. You may invoke custom actions directly from a workflow or dialog without writing a code.

Actions can also be invoked by running a customized code.

You can call actions in the following ways:

  • From code that triggers within a plugin or custom workflow.
  • X`From a command this is positioned within the software and executes the operation utilizing javascript code.
  • From an integration with some other system that makes use of the dynamics 365 for Customer Engagement web services.
  • From a custom client application that makes use of the dynamics 365 for consumer engagement web services.

Actions open a variety of opportunities for composing business logic. Before Actions, the primary way to enforce enterprise approaches became restrained to plug-ins or custom workflow activities. With Actions, you can carry out operations, including create, update, delete, assign, or perform action. Internally, an action creates a custom message. Developers check with these actions as “messages”. Each of these messages is based totally on actions taken on an entity record. The purpose of methods is to create a record, then update it, after which assign it.

Actions provide the capability to outline a single verb (or message) that fits an operation you want to carry out in your business. These new messages are driven via a process or behavior instead of what may be executed with an entity. These messages can correspond to verbs like escalate, convert, schedule, route, or approve – anything you need. The addition of these verbs helps provide a richer vocabulary to fluently outline your business processes. You can follow this richer vocabulary from clients or integrations in preference to having to put in writing the action within clients. This additionally makes it less difficult because you can manipulate and log the fulfillment or failure of the entire action as a single unit.

Learn more about our Microsoft Dynamics 365 Services 

Learn More

Create Global Action with Dynamics 365 API:

Step 1: For the creation of Global Action Go to “Setting” then “Processes” after Click on “New”

global action setting

Step 2: Then select “Category” as “Action” and Entity as “None(Global)” as you can see in the below screenshot.

global action process

Step 3: After Clicking “OK” we can see the below screen.

process uprest information

Step 4: It accepts an input and output parameter. You can also specify parameters of any of the following information Types.

input and output parameter

Step 5: Once you define all the Arguments Parameters then the actions will look like this.

Arguments Parameters PowerApps

Calling Custom Action From JS

Below is the code snippet to trigger the Custom Action from JS.

Custom Action from JS

So, we can trigger the Custom action from the JS and achieve our desired functionality.

Explore our Microsoft Dynamics 365 Services 

Learn More

Hope this will be helpful.

Thanks!!!

Conclusion

So, we can use Dynamics 365 API function in JS to trigger the Custom Action to complete the functionality that we are desire. If you have any question or queries, do not hesitate to reach out to us