Using business rule to change value on form

TerryC03
Tera Expert

Hello,

Is it possible to use a business rule to change a state on the form view? The business rule is working as intended on the list view, but not on the form itself. The script is written in a PDI.

TerryC03_0-1707328383934.pngTerryC03_1-1707328428798.png

When the if statement is true, I want the state to change back to the previous state from "Released" state on update/form refreshed. For example, if there are any SAFe stories associated with the SAFe Feature that are not Complete or Cancelled, and the user tries to change the state to "Released" on Save/Update, the state will revert back to the previous on page reload.

TerryC03_2-1707328551562.png

 

TerryC03_3-1707328599832.png

 

 

1 ACCEPTED SOLUTION

TerryC03
Tera Expert

Hello Everyone,

Thanks for your advice. The issue was resolved by increasing the order of the business rule.

View solution in original post

6 REPLIES 6

Hugo Barros
Tera Contributor

Hi Terry,
Try:

var previousState = previous.getValue("state");
current.setValue("state", previousState); //replace your line 12 with this two lines 

hope that helps!


TerryC03
Tera Expert

Hello Everyone,

Thanks for your advice. The issue was resolved by increasing the order of the business rule.