How to run UI Policy validation from UI Action? (UI Policy vs UI Action runtime order)

jamesmcwhinney
Giga Guru

From what I can tell, the UI Action runs before the UI policies.

For example, if I click a UI action "Resolve Incident", it sets the state to "Resolved" and then submits the form.

The UI policies then run afterwards and tell the user that they have forgotten a number of fields.

I have been asked to not set the state to "Resolved" until after the form is submitted (After the validation is successful).

I realize I could duplicate the mandatory field logic within the UI action, but I feel this will be redundant and an annoying practice to adopt.

Is there any way to call the UI policies from within the UI Action? (Ensure the UI policy mandatory fields are filled in before setting the state to "resolved"?)

Thanks,

- James

1 ACCEPTED SOLUTION

Abdul Khan4
Kilo Guru

Hi James,



I suggest to make a generic functions in UI Script. Call this generic script from UI action and UI Policy or Client Script.



Regards


Abdul Khan


View solution in original post

7 REPLIES 7

Abdul Khan4
Kilo Guru

Hi James,



Please click client and write a UI script. Call this UI script from onclick



find_real_file.png



find_real_file.png


Could you provide some more explanation?


Im not sure I understand how this relates to my issue.



Thanks!


Abdul Khan4
Kilo Guru

Hi James,



I am not sure how to call UI policy using UI action, but you can do all required validation on your form using UI Script as i explained above.


Please let me know if it makes sense to you.



Regards


Abdul Khan


Thanks Abdul,



Yeah I can also put the validation in the UI action itself,. I was just hoping to avoid putting it in two places (UI Action + UI Policy), (UI script + UI policy).