How to Move to Next Stage Automatically in Business Process Flow

Microsoft Dynamics CRM 2015 supports Next Stage Automatically. This action is possible in CRM Form’s current selected

Business Process Flow via JavaScript.Write scripts for business process flows

 

desc1

 

Using JavaScript saves the Microsoft CRM users time from manually clicking on the “Next Stage” in order to advance to the next Stage.  It also checks if the stage advance conditions have been met before advancing.

Here is an example JavaScript that I would call from the CRM Form’s OnSave event:

function MoveNextStage()) {

    var selectedProceess = Xrm.Page.getAttribute(“new_processselection”);
    var selectedProcessValue = selectedProcess.getValue();
    if (selectedProcessValue == 2) {
        //Set Guid for Sales Order Prcoess 1

        Xrm.Page.getAttribute(“processid”).setSubmitMode(“always”);
        Xrm.Page.getAttribute(‘processid’).setValue(‘stage guid′);

        //Set Guid for Sales Order Prcoess 1 Stage Propose
        Xrm.Page.getAttribute(“stageid”).setSubmitMode(“always”);
        Xrm.Page.getAttribute(‘stageid’).setValue(‘stage guid′);

        //Call Entity save
        Xrm.Page.data.entity.save();

        //Call window refresh
        window.location.reload(true);
    }
}

About Apps Now

Apps Now offers latest reads on Microsoft Technologies and Business Applications in an easily understandable and digestible manner for you to drive some mileage out of it. Keep following Apps Now to learn new technologies and best coding practices.

See more blogs from Apps Now

No Comments

Add a Comment

  1. (max length 2000)
  2. captcha refresh captcha
Please Wait