Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article describes the steps required to create a fulfillment provider in Microsoft Dynamics 365 Intelligent Order Management.
Create new provider definition
To create a new provider definition, follow these steps:
- Go to Providers > Catalog.
- Select New Provider Definition.
- For Display Name, enter "IOMLabFulfillmentProvider".
- For Logical Name, enter "msdyn_IOMLabFulfillmentProvider".
- For Description, enter "IOM lab fulfillment provider".
- For Logo, select "IOMLab.png".
- For Service Type, enter "Fulfillment".
- Select Save and close.
Add provider definition to solution
To add a provider definition to the solution, follow these steps:
- Go to the Power App Maker portal and navigate to the newly created solution IOMLabProviders.
- Select Add existing > IOM Provider Definition.
- Select IOMLabFulfillmentProvider and then select Add to add it to the solution.
Create provider action to send a fulfillment payload to Outlook
To create a provider action that sends a fulfillment payload to Outlook, follow these steps:
Go to the Power App Maker portal and navigate to Solutions.
Open the Default Solution.
Select New.
Select Cloud Flow, and then name it "IOM Lab Send To Fulfillment (Outlook)".
Select the trigger type as HTTP trigger
- Define a Power Automate trigger. Typically, this trigger is an HTTP endpoint that acts as a webhook trigger (recommended), connector trigger, or a Dataverse insert trigger. The trigger starts when an external service sends data to Intelligent Order Management.
Use the following JSON Schema in your HTTP trigger.
{ "type": "object", "properties": { "text": { "title": "ProviderActionExecutionEventId", "type": "string", "x-ms-dynamically-added": true, "description": "Please enter your input", "x-ms-content-hint": "TEXT" }, "text_1": { "title": "EntityRecordId", "type": "string", "x-ms-dynamically-added": true, "description": "Please enter your input", "x-ms-content-hint": "TEXT" } }, "required": [ "text", "text_1" ] }
Add a Try scope.
Within the Try scope, add a Perform an unbound action action as follows:
- ProviderActionExecutionEventId: Under Dynamic content, select ProviderActionExecutionEventId.
- PowerAutomateRunId: Specify the following as an expression:
workflow()['run']?['name'].
Add a Get a row by ID action and then do the following:
- For Table name, enter "Fulfillment Orders".
- For Row ID, select EntityRecordId under Dynamic content.
Add a Send an email action from the Outlook.com connector, as follows. There are couple of email connectors, make sure to select Outlook.com since that's the connection set up earlier.
- On the To line, "placeholder@placeholder.com" is used as placeholder text. This text is replaced by a provider parameter in later steps.
- On the Subject line, "name" is obtained from the Get fulfillment order step under Dynamic content.
- For Body, specify the following as an expression:
outputs('Get_fulfillment_order')['body']
Add a List rows action as follows:
- For Table name, enter "Fulfillment Order Products".
- For Fetch Xml query enter the following:
<fetch> <entity name="msdyn_fulfillmentorderdetail"> <all-attributes /> <filter> <condition attribute="msdyn_fulfillmentid" operator="eq" value="@{triggerBody()['text_1']}"/> </filter> </entity> </fetch>
Add an Apply to each control with a Send an email action as follows:
- value is obtained from the Get fulfillment order line step under Dynamic content.
- name is obtained from the Get fulfillment order line step under Dynamic content.
- Current item is selected from under Dynamic content.
Within the loop, add an Append to array variable action as follows:
- For Name, enter "ProcessedFulfillmentOrderLines".
- For Value, select Fulfillment line ID from under Dynamic content.
Within the loop, add another Append to array variable action as follows:
- For Name, enter "ProcessedSalesOrderLines".
- For Value, select Sales line ID from under Dynamic content.
Collapse the Try scope by selecting its title bar.
Select New step and add another scope named "Catch".
On the Catch scope, select the ellipsis ("..."), select Configure run after, and configure as follows:
- Select the has failed checkbox.
- Select the has failed checkbox.
In the Catch scope, select Add an action and add a Set variable action. Rename the action to "Set the execution result to failed".
Configure the properties as follows:
- For Name, enter "ExecutionResult".
- For Value, enter "false".
Select New step, and add another scope named "Finally".
On the Finally scope, select the ellipsis ("..."), select Configure run after, and configure as follows:
- Select the is successful checkbox.
- Select the has failed checkbox.
- Select the is skipped checkbox.
- Select the has failed checkbox.
In the Finally scope, add a "condition" step and compare the ExecutionResult variable to true as follows:
- In the first field, select the ExecutionResult variable.
- In the second field, select is equal to.
- In the third field, select true.
In the If yes branch, add a Run a child flow action and rename it "Raise Business Events for processed fulfillment order lines".
Configure the properties as follows:
- For Child flow, enter "IOM Raise Business Event".
- For BusinessEventDefinitionId, enter "063d85c8-60a4-eb11-9443-000d3a313675".
- For EntityRecordId, specify the following as expressions:
string(variables('ProcessedFulfillmentOrderLines'))
In the If yes branch, add another Run a child flow action and rename it "Raise Sales Order Aggregated Events".
Configure the properties as follows:
- For LineBusinessEventDefinitionId, enter "ccf64002-61a4-eb11-9443-000d3a313675".
- For LineRecordId, specify the following as an expression:
string(variables('ProcessedSalesOrderLines')). - For OrderBusinessEventDefinitionId, enter "48688716-61a4-eb11-9443-000d3a313675".
Collapse the condition step.
Add a Perform an unbound action action as follows:
- For Action name, enter "msdyn_CompleteProviderActionExecution".
- For ExecutionResult, select the ExecutionResult variable from under Dynamic content.
- For ProviderActionExecutionEventId, select ProviderActionExecutionEventId from under Dynamic content.
Select Save.
Add a provider definition logic definition to the Outlook provider definition
To add a provider definition logic definition to the Outlook provider definition, follow these steps:
- Go to Providers > Catalog.
- Select the newly created IOMLabFulfillmentProvider.
- Select Edit on the menu bar.
- Select the Logic definitions tab.
- Select + New IOM Provider Definition Logic Definition.
- For Display Name, enter "IOM Lab Send to Fulfillment (Outlook)".
- For Logical Name, enter "msdyn_LabSentToFulfillmentOutlook".
- For Provider Definition, enter "IOMLabFulfillmentProvider".
- For Logic Type, enter "Provider Action".
- For Workflow Name, enter "IOM Lab Send to Fulfillment (Outlook)".
- For Timeout Minutes, enter "2".
- For Max Retry Attempts, enter "3".
- For Description, enter "IOM Lab Send to Fulfillment (Outlook)".
- For Action Type, enter "Send to Fulfillment".
- Select Save. This action generates a JSON representation of the message handler cloud flow and populates the Client Data field.
- Replace the placeholder email with provider parameter as follows:
- Copy the text block in the Client Data field and paste it into Notepad.
- In the text block, find "placeholder@placeholder.com" and replace it with "{{IOMLabOutboundFulfillmentEmail}}".