Activate Order button is not working on Order Entity in UCI - CloudFronts

Activate Order button is not working on Order Entity in UCI

Posted On October 10, 2018 by Admin Posted in 


This blog explains an alternative approach to Activate an Order in UCI.


We are using Prospect to Cash solution to integrate Sales Order from Sales to Operations (CRM To Operations). In UCI Activate Order button is not working which is used for Order Integration. In this blog we will see an alternative approach to achieve this.


  •    D365 Sales
  •    Microsoft Flow

Steps to be followed:

Dynamics 365 –

1. Create Custom “Activate Order” button in UCI.

2. Add below JavaScript code which will trigger on Click of “Activate Order” Button.

(This code will take the Order Guid and pass it to the http post request)

Refer this blog to understand more about HTTP Post Request using Microsoft Flows:

// JavaScript source code
CallMSFlowsToActivateOrder: function () {
    var entityGuid =;
    entityGuid = entityGuid.replace("{", "").replace("}", "");

    var data = JSON.stringify({
        "OrderID": entityGuid

    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;

    xhr.addEventListener("readystatechange", function () {
        if (this.readyState === 4) {

    var xhr = new XMLHttpRequest();"POST", "URL Created From MS Flow", true);
    xhr.setRequestHeader('Content-Type', 'application/json');
        "OrderID": entityGuid

Microsoft Flow:

1. Create Flow from Blank.

2. Select the Http request is received trigger.

3. Add below in Request body JSON Schema

4. Add Get Record Trigger of Dynamics 365. In Item identifier pass the OrderId from the Dynamic Content.

5. List all related Sales Order Product of that Order.

6. Add apply to each control and update the value of Order is Active field.

7. Update the Processing state field of Order entity.

Overall Flow:

Share Story :