How do you call a script include from a a UI policy condition?

e_wilber
Tera Guru

There is a field on the form that should only show under a condition I can't add to the condition builder directly that returns a true/false value.

 

How do I call this from a UI policy condition? The condition requires us to choose a field as the first parameter but I'm not actually applying this to a specific field at all. I just want to know if my script include returns true or false.

3 REPLIES 3

Claude DAmico
Kilo Sage

You should be able to use the Script section to call the Script Include. If you don't see it, make sure you've clicked Advanced View under Related Links.

Claude E. D'Amico, III - CSA

Unless I am wrong, the script section is only used after conditions are met/not met but aren't used to actually build the trigger condition of the UI policy.

It's still possible to use. Imagine this...

  1. No condition resolves to TRUE in all cases.
  2. Execute if true script calls the Script Include via GlideAjax since it is a client type script
    1. If TRUE, g_form.setDisplay('field',true);
    2. If FALSE, g_form.setDisplay('field',false);

The alternative to scripting the policy is Client Script for onLoad of the form or whatever captures the requirements (onSubmit, onChange, etc.)

Claude E. D'Amico, III - CSA