Hello,
I have a requirements of creating a Business Process Flow and I have a field of status reason (out of box field with some custom options in it). The requirement is to change the stage of Business Process Flow according to the change of a value of option set field. For example if I choose value as value 1 in option set then the BPF stage should switch to option1 and if option set field set to option 2 then again BPF stage set to option 2.
If I set back to option 1 from option 2 in option set value then BPF stage switch back to option 1. Please help me if anybody having a solution on this requirement. Also let me know which method I have to follow to implement this requirement i.e. using BPF UI or using JavaScript code?
Thanks
AR
Hi AR,
I think there is possibility to achieve this. Just register a OnSave method on the form. Call the BPF change method based on OptionSet field.
var=formContext.getattribute(OptionSet);
if var=xxx
then
In order to achieve this, you have to use the methods formContext.data.process.moveNext and formContext.data.process.movePrevious so you can move back and forth in the active BPF of the form.
function moveBPFToNextStage(context) {
var formContext = context.getFormContext();
formContext.data.process.moveNext();
}
function moveBPFToPreviousStage(context) {
var formContext = context.getFormContext();
formContext.data.process.movePrevious();
}
Besides, you can consider using workflow as well to better meet your requirement.
Hi,
There is now way to achieve your requirement using only Javascript.
You can use workflow to change BPF stage based on your field value. Please see below blog which explains the steps to achieve the same.
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,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156