CREATING A CUSTOM ACTION AND CALLING IT FROM WEB API IN DYNAMICS 365 POWER APPS

Talha Manzoor
0

 In Dynamics 365 and Power Apps, we can create Custom Actions and use these with plugins to invoke business-specific code through the Power Apps / Dynamics 365 Web API. These actions don’t even need any parameters to run and can contain no steps. They will simply execute our custom code, which can do whatever we want and we can invoke when we want.

In this example, let’s create a plugin that will create a contact called “Bob Smith” (simple example). Unlike other plugins, we won’t register this to run when a typical message such as a create/retrieve/update/delete runs on an entity. Instead, we will create a new custom Action in the process designer and will call it from JavaScript code through the Web API, showing we can have this new code run how we want it to (without binding it to an event).

First, let’s create a new plugin. Open Visual Studio and create a new Class Library.

Install the Microsoft.CrmSdk.CoreAssemblies using NuGet:

Rename the file to CustomAction (or whatever you want) and add the code below, where we are using IPlugin and code in our Execute method to create a new contact:

Read More


Post a Comment

0Comments

Post a Comment (0)