Dynamics 365 is a metadata-driven application which we sometimes need to create an Action to be executed on multiple entities, so we can use Global Action in Dynamics 365.
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.
- 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.
Create Global Action:
Step 1: For the creation of Global Action Go to “Setting” then “Processes” after Click on “New”
Step 2: Then select “Category” as “Action” and Entity as “None(Global)” as you can see in the below screenshot.
Step 3: After Clicking “OK” we can see the below screen.
Step 4: It accepts an input and output parameter. You can also specify parameters of any of the following information Types.
Step 5: Once you define all the Arguments Parameters then the actions will look like this.
Calling Custom Action From JS
Below is the code snippet to trigger the Custom Action from JS.
So, we can trigger the Custom action from the JS and achieve our desired functionality.
Hope this will be helpful.
So, we can use Dynamics 365 API function in JS to trigger the Custom Action to complete the functionality that we are desire.