I am curious about to know that can we clone existing business process flow and assign it to new custom entity using javascript code?
Any helps will be appreciated.
Thanks in advanced.
*This post is locked for comments
So the workflow will be changed or it will be cloned with new entity?
Yes it's possible if you have BPF then you can switch process using javascript below method.
// pass BPF GUID here in below line
Xrm.Page.data.process.setActiveProcess(procesId, CallBack);
function CallBack(response) {
if (response == “success”) {
alert(“BPF changed !!!”);
// Save the form
Xrm.Page.data.entity.save();
}
}
Hi partner,
Here is a blog about JavaScript with BPF and I'm afraid that there is no related functions with JavaScript.
https://www.powerobjects.com/2015/10/13/business-process-flows-and-javascript/
In addition, the requirement that you described should be the logic of custom plug-in.
You could try to achieve this by using C# code and creating plug-in.
Here are some samples about how to use C# to operate BPF.
https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/sample-code-processes
Hope it helps.
Best Regards
Leo
Hi,
you can refer below article on how to use JS to assign BPF.
community.dynamics.com/.../162847
rajeevpentyala.com/.../switch-business-process-flow-using-jscript-based-on-crm-forms-field-value
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156