web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Two custom business process flows was working on one entity by using javascript

(0) ShareShare
ReportReport
Posted on by 425

I have tried the same query in trail version 1710 (9.1.0.323) online. Its working fine.

I have bound this script in the onload event of case entity

function gettypes()
{
debugger;
var activeProcess = Xrm.Page.data.process.getActiveProcess();
var activeProcessId= activeProcess.getId();
var activeProcessName= activeProcess.getName();
if (activeProcess != null) 

if(Xrm.Page.getAttribute('title').getValue() != null)
{
var businessProcessProductId="C4CD0E53-5CCB-446B-A43C-6514B5FE5B88";
//var businessProcessServiceId="7FB897AA-2C6B-4248-953C-47E0925186BB";
var businessProcessDefaultId="0FFBCDE4-61C1-4355-AA89-AA1D7B2B8792"; 
if(activeProcessId.toLowerCase() != businessProcessProductId.toLowerCase())

Xrm.Page.data.process.setActiveProcess(businessProcessProductId, callbackFunction); 
}
}
else { 
Xrm.Page.data.process.setActiveProcess(businessProcessDefaultId, callbackFunction);

}
else {
//Xrm.Page.data.process.setActiveProcess(businessProcessDefaultId, callbackFunction);

}
function callbackFunction(response) 
{
if (response == "success") 
{
alert("BPF changed !!!"); 
}
else 
{
alert("Error changing BPF!!!");
}
}


javascript is not working for 3 bpfs(1 default and 2 custom bpf) 

I have tried with in my trail version only.

Onchange and onload events.
for me, Callbackfunction is "invalid"

The above query was updated with another new bpf guid.

My script is:-

function gettypes()
{
debugger;
var activeProcess = Xrm.Page.data.process.getActiveProcess();
var activeProcessId= activeProcess.getId();
var activeProcessName= activeProcess.getName();
if (activeProcess != null) 

if(Xrm.Page.getAttribute('title').getValue() != null)
{
var businessProcessProductId="C4CD0E53-5CCB-446B-A43C-6514B5FE5B88";
var businessProcessServiceId="066FCE70-722F-469C-811A-55A77BBA0B6C";
var businessProcessDefaultId="0FFBCDE4-61C1-4355-AA89-AA1D7B2B8792"; 
if(activeProcessId.toLowerCase() != businessProcessProductId.toLowerCase())

Xrm.Page.data.process.setActiveProcess(businessProcessProductId, callbackFunction); 
}
}
else { 
Xrm.Page.data.process.setActiveProcess(businessProcessServiceId, callbackFunction); 

}
else {
//Xrm.Page.data.process.setActiveProcess(businessProcessDefaultId, callbackFunction);

}
function callbackFunction(response) 
{
if (response == "success") 
{
alert("BPF changed !!!"); 
}
else 
{
alert("Error changing BPF!!!");
}
}

*This post is locked for comments

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans