Using Custom Process Action with Code for integration – Dynamics 365 / Microsoft Dataverse


There are 2 ways to create a custom message in Dataverse, one is through action, and the other is through Custom API.

Check the post on Custom API

https://nishantrana.me/tag/custom-api/

https://nishantrana.me/2021/01/13/use-custom-api-to-create-custom-messages-in-dynamics-365/

Custom Process Action vs Custom API –

https://docs.microsoft.com/en-us/powerapps/developer/data-platform/custom-actions#compare-custom-process-action-and-custom-api

With custom process action we can define business logic using a workflow, and we can extend it using either custom workflow activities or registering the plugin.

If we are just defining action just for the custom message and then using plugin/custom workflow activity for defining all the logic (and not using workflow), it is recommended to use the Custom API feature instead.

Here however we will have a look at the way we had implemented global custom action for integration with the external system for any inbound call to CRM.

Below is our sample custom global action with one input and output parameter.

For the output parameter, we are setting the value in the step.

Next, we have 2 plugin steps registered one on the pre-validation stage and the other on post-operation.

Pre-validation because we want to run the logic outside the transaction, perform validation, log exceptions, etc.

Pre-validation example –

https://nishantrana.me/2018/11/05/plugin-on-pre-validation-stage-in-dynamics-365-ce/

https://community.dynamics.com/365/sales/b/crminogic/posts/plugin-pre-validation-operation-to-show-an-error-message-as-well-as-log-the-error

Post-operation because action’s output parameter would only be available in the post-operation and used Shared Variable to pass the custom response from pre-validation plugin to post-operation.

On executing the action

We get the following plugin trace logs as expected.

One for pre-validation

Post-operation

Hope it helps..

Advertisements

Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

Please share your thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Power Spark

Power Spark By Shrangarika

Van Carl Nguyen

Exploration of Power Platform

My Trial

It is my experience timeline.

Power⚡Thomas

Sharing my knowledge and experience about the Microsoft Power Platform.

Arpit Power Guide

a guide to powering up community

Welcome to the Blog of Paul Andrew

Sponsored by Cloud Formations Ltd

Deriving Dynamics 365

Deriving Solutions and features on Power Platform/Dynamics 365

The CRM Ninja

Thoughts & musings from a Dynamics 365 Ninja!

D CRM Explorer

Learn about Microsoft Dynamics CRM Power Platform customization and implementation and other cool stuffs

Stroke // Jonas Rapp

I know pre-stroke. I will improve who I was.

Power Melange

Power Melange By Shalinee

Clavin's Blog

Power Automate - Power Apps - SharePoint Online - Azure - Nintex - K2 - Artificial Intelligence

Sat Sangha Salon

An Inquiry in Being

The Indoencers

The Influencers & Influences of Indian Music

Monika Halan's blog

Hand's-free money management

D365 Demystified

A closer look at Microsoft Dynamics 365.

Microsoft Mate (msftmate) - Andrew Rogers

Experienced consultant primarily focused on Microsoft Dynamics 365 and the Power Platform

Knowhere365

Specific topics by Django Lohn on the whole Microsoft365 Stack

Manmit Rahevar's Blog

One Stop Destination for Microsoft Technology Solutions

MG

Naturally Curious

Brian Illand

Power Platform and Dynamics 365

Steve Mordue MVP

A Microsoft Business Applications MVP

Subwoofer 101

Bass defines your home theater

SQLTwins by Nakul Vachhrajani

SQL Server tips and experiences dedicated to my twin daughters.

Everything D365

Discovering Azure DevOps and D365 Business Applications

Tech Wizard

Lets do IT Spells

XRM Tricks (Power Platform & Dynamics CRM )

Power Platform & Dynamics CRM

CRM TIPS BY PRM

Mail to crmtipsbyprm@gmail.com for queries and suggestions

nijos.dev

Giving back to the community what I have learned

xrm CRM Dynamics

Dynamics CRM Technical & Functional Info

Dynamics 365 Blogs - Explained in unique way

Sometimes you need to look at things from different perspective.

CRM Keeper

Dynamics 365 Customer Engagement, CRM, Microsoft CRM, Dynamics CRM