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
Mohamed Amine Mahmoudi
83
Super User 2025 Season 1
Community Member
54
Victor Onyebuchi
6