Skip to main content

Notifications

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

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans