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
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);
}
}
