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

Announcements

News and Announcements icon
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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans