Tuesday, 18 October 2022

BPF auto movement in dynamics crm - Using javascript ( please refer next blog using plugin)

 Moving to next stage : 

Consider the below JavaScript code which is fired during OnSave event of the form record. 


function BPFMove(executionContext) {

    //Initiated Form Context.

    var formContext = executionContext.getFormContext();

    //Getting Value From Field Account Closed.

    var AccountClosed = formContext.getAttribute("accountclosed").getValue();

    //Condition If Account Closed Is True.

    if (AccountClosed === true) {

 //Moving Chevron To Next Stage.

formContext.data.process.moveNext();

    }

}





Moving to previous stage :

function BPFMove(executionContext) {

   //Initiated Form Context.

    var formContext = executionContext.getFormContext();


    //Getting Value From Field Account Closed.

    var AccountClosed = formContext.getAttribute("accountclosed").getValue();


    //Condition If Account Closed Is False.

    if (AccountClosed === false) {


        //Moving Chevron To Previous Stage.

        formContext.data.process.movePrevious();

    }

}

No comments:

Post a Comment

How to Trigger a Microsoft Flow from a Custom Button in Dynamics 365

  When using Microsoft Flow the out-of-the-box button is nested under the ‘Flow’ section and is not easy to find nor is it customizable. Tri...