Hi Experts,
I am having 3 different forms for custom entity and 2 business process flows(Dynamics CRM 365 Online). I want to display business process flow as per the form selected. In below script, I am getting "invalid" result in callbackFunction and BPF is not setting on the form. Both BPFs are activated on the screen.
function ChangeProcess(executionContext) {
//debugger;
var formContext = executionContext.getFormContext();
var formLabel = formContext.ui.formSelector.getCurrentItem().getLabel();
var guid1 = "bE0E84B9E-A4BF-4R71-B861-87EF2F394BF9";
var guid2 = "E0AE43C5-8FC9-4479-99CC-F70F12BA82C3";
if ((formLabel == "New Facility") || (formLabel == "Material Change"))
{
Xrm.Page.data.process.setActiveProcess(guid1, callbackFunction);
}
else if (formLabel == "Non Material Change") {
Xrm.Page.data.process.setActiveProcess(guid2, callbackFunction);
//formContext.data.process.setActiveProcess(guid2, callbackFunction);
}
}
function callbackFunction(result) {
if (result == "success") {
alert(result);
}
else {
alert(result);
}
}
Kindly suggest.
*This post is locked for comments
I have the same question (0)