Dynamics 365 Business Central
Category
Dec 6, 2023
Published date
Text
Article Type
AI Summary
- The article discusses the use of Business Events in Dynamics 365 Business Central and Power Platform.
- The latest release of Dynamics 365 Business Central and Power Platform introduces a new trigger in Power Automate flows called "When a business event occurs (V3) (Preview)".
- The Dynamics 365 Business Central connector allows for direct communication with Dynamics 365 Business Central to establish a subscription to the event.
- Business events in Dynamics 365 Business Central are divided into categories/modules and include events such as customer blocked/unblocked, opportunity activated/closed as lost, quote created for opportunity, and more.
- The article provides an example of a business event triggered when the "Status" field is modified, and explains the need to track these changes and notify someone in the organization.
- The Power Automate flow is built by selecting the "When a business event occurs (V3)" trigger and specifying the necessary parameters.
- User details and additional information about the user status change can be obtained using the "Get user profile (V2)" and "Get record (V3)" actions.
- The flow can be completed by using the "Post message in a chat or channel" action to post a message in Microsoft Teams, combining information from previous steps.Thought: This is the summary of your work so far:Current Task: Create a summary that captures the essential points and main ideas.Utilize the content provided to generate a concise and informative summary that encapsulates the key messages of the article titled Dear reader,after not blogging for a while, I am slowly returning to one of my first passions.In this blog post, I will share my experience as a business consultant in working with Business Events that are available for Business Central.This blog post extends my colleague Milan Milinčević’s blog on building a business event from scratch that you can find at this URL: https://mmilince.com/2023/11/business-events-in-bc/With the latest release of Dynamics 365 Business Central and Power Platform, we have a new trigger in Power Automate flows called When a business event occurs (V3) (Preview).Dynamics 365 Business Central connector communicates directly with Dynamics 365 Business Central to establish a subscription to the event. Once a Dynamics 365 Business Central business event is triggered, the flow will take data from business events.All Dynamics 365 Business Central business events are divided into categories/modules. Currently, we have the following available business events:Customer blocked Customer unblocked Opportunity activated Opportunity closed as lost Quote created for opportunity Winning quote converted into sales order Purchase credit memo posted Purchase invoice posted Purchase order released Purchase payment posted Purchase receipt posted Sales credit limit exceeded Sales credit memo posted Sales invoice posted Sales order released Sales payment posted Sales shipment postedIn our example, Milan developed a business event triggered when field Status has been modified from one state to another. For example, someone can modify the user state from active to inactive or vice versa. To track those changes, someone in the organization has to be notified. Also, in our example within our Business Events, we got values for:initiatingUserIdUserSecurityIdIsEnabledTo start building the Power Automate flow, navigate to https://make.powerautomate.com/ and then select + Create, and after that, select Automated Cloud Flow.A new pop-up window will open where you can enter the Power Automate flow name and choose flow trigger. In Choose your flow’s trigger, I usually try to find my trigger by filtering the list of triggers with needed phrases. In my example, it is When a business event occurs.In a few seconds, when I scroll down, I will find a trigger for Dynamics 365 Business Central named When a business event occurs (V3). Select that trigger and after that select Create.In a flow editor, select trigger When a business event occurs (V3) , and new side window will open where you have to specify parameters for the trigger.Mandatory parameters are the Environment and a business event that is going to trigger the Power Automate flow.In the list of Business Events, you will find all developed by Microsoft business events and your custom business events.An optional parameter that is available in Advanced parameters is the Company parameter.The next steps are to build flow around Dynamics 365 Business Central, a business event trigger. We will post a message in Microsoft Teams when the user is active/inactive.I will first get user details about the user who initiated that change. To get user details who initiated the change, we have as an output from When a business event occurs (V3) trigger, a parameter named initiatingUserId that contains the ID of the user that performed the change. Based on that information and combined with the Get user profile (V2) Outlook connector, I can easily get details about user profiles from Microsoft 365.The next step in our demo was to get users additional details about the user status change, as the business event didn’t pass it to the flow (by design). For that, I used Get record (V3) action. I chose the correct environment and company. I used the standard Microsoft API available in the Microsoft/automation/v2.0 folder to get user information. Last, I used the UserSecurityId parameter to get Row Id from the When a business event occurs (V3) trigger.The last step was to post a message in a chat or channel in Microsoft Teams. I used standard out-of-the-box action Post message in a chat or channel. All you have to do is to choose how the message should be posted and in which chat/channel you want to do it. Also last step is to compose a message, and you can combine information from triggers and actions from previous steps.Details about the Full user name that is now active or inactive we used from the Get record (V3) action. State if the user is active I took from When a business event occurs (V3). The last part is about a person who disabled/enabled a user I got from the Get user profile (V2) action.You can also get the user state from the Get record (V3) action, but as Milan already added the parameter IsEnabled in the business event, I decided to use it for my demo.More details about Business events in Dynamics 365 Business Central are available here Business events on Business Central (preview) – Business Central | Microsoft LearnI hope you will find it useful, and if you have questions/comments, don’t hesitate to contact us.Thanks,RenatoTags:.
Registered users can view the full text for FREE!
Sign In Now!