No-Code: Extend MSDyn365FO with the Power Platform

No-Code: Extend MSDyn365FO with the Power Platform

No-Code solutions are here to stay, you just have to see the amount of content, use cases, articles, videos and events dedicated, for example, to the Microsoft Power Platform. In my specific case, I do not think that this platform has come to replace all the customizations that we do through X++, although they can help us solve certain problems without the need to generate code, in a faster, cheaper way and easier to maintain.

Let’s put a use case for Finance and Operations: We need to notify a user or group of users when customers are modified and are blocked/unblocked for billing, payments, all… (Update the Blocked field of the CustTable).

As a programmer, the first thing I think is: Ok, there is no Business Event that is triggered when a client is modified, so, I will create my own custom event, which gives me the information I need and is executed when I need it, right? But… wait! If we have an alert framework that works perfectly and a business event that is triggered when one of these alerts occurs, why not take advantage of it? It is clear that the alert that is launched may not have all the information we need, but playing a little with Power Automate we can get it in a few minutes, let’s get to it ;).

The first thing, obviously, is to configure the alert rule. We will create a new one that will be executed when the Blocked field of the CustTable table is edited. It is important to check the Send externally check to yes.

Create alert rule
Send externally

Once we have the alert configured, we create an automated flow of Power Automate using the When a business event occurs trigger from Dynamics 365 F&O.

Build and automated flow
When a Business Event occurs

Important, if we leave the Flow trigger as it is right now, it will be executed for each of the alerts configured in the system. To avoid this and focus only on the alerts that interest us, we can configure a series of filters, and the flow will only be executed when the alert triggered meets the filter conditions.

Trigger conditions

Once we save the flow, we can check in the Dynamics F&O event catalog that the BusinessEventsAlertEvent business event has been activated against a Power Automate endpoint.

Alert business event active

The next thing we will do is create a series of Compose-type steps to mount an Adaptive Card that we will post in Teams to notify the user of the change that has occurred in one of the system’s clients. This message will consist of the customer’s account and name, as well as the new value of the Blocked field.

If we take a look at the JSON that generates the alerts event, we see that in the KeyValue1 and KeyValue2 fields we receive both the client code and its name, but there is no field in which we receive the value of the Blocked field. Is that a problem? Not at all, since Power Automate has a series of connectors that allow us to obtain specific records and the alert business event provides us with the necessary data to search for the client (DataAreaId and CustAccount). Therefore, we are going to get the customer record that has been modified.

Obtener registro de cliente
Get customer record

Now, we have all the fields of the CustCustomerV3Entity entity, so we are able to assemble the message and the structure of the Adaptive Card and publish it in Teams through the specific connector that will be in charge of sending a message to the specific user.

Adaptative card text through compose action
Adaptive card structure through compose action
Post adaptive card as flow bot to a user

After these steps, we only have to save the flow and test it, so we go to a customer, modify the value of the Blocked field and wait for the magic to happen.

Posted adaptive card with flow bot to the user (in Spanish)

As you can see, a new message has been published in Teams through the Flow bot indicating that the value of the Blocked field has been modified for a specific customer. In addition, a button appears, and if we click on it, it will take us to the customers form, filtering directly by the customer that we have modified, all this thanks to the Link field that is published in the alerts business event.

Finance and Operations customers form filterd by a customer

To finish the article, I leave you with a video in which we see the operation of what was explained above and I tell you some tricks to take into account to achieve that the result is as expected and that everything works correctly. I hope you like it 🙂 (As usual, the video is in Spanish)

No-Code: Extend MSDyn365FO with the Power Platform (Spanish). Powered by ERD

If you want to know more options on how to use the Power Platform to extend Finance and Operations apps, I recommend you pay attention to this series of TechTalks presented by Rachel Profitt.

See you soon!

3 comments / Add your comment below

  1. Hi,
    I did everything in this guide, but my flow is not triggering.
    I have checked that business endpooint, business event and batch job is all okay.
    Is there any more troubleshooting I can do?

    1. Hi Malte,
      Are you sure that the Business Event is triggered? Are you able to debug the code and see that the send() method is being executed?
      If so, have you taken a look to the BusinessEventsCommitLog? In this table, a record is created once the business event is triggered, and it is deleted once the data is sent to the external application. If this table is empty, it should be ok.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

Uso de cookies

Este sitio web utiliza cookies para que usted tenga la mejor experiencia de usuario. Si continúa navegando está dando su consentimiento para la aceptación de las mencionadas cookies y la aceptación de nuestra política de cookies, pinche el enlace para mayor información. ACEPTAR

Aviso de cookies