How do you call a script include from a a UI policy condition?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 12:32 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 01:46 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 01:55 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 02:07 PM
It's still possible to use. Imagine this...
- No condition resolves to TRUE in all cases.
- Execute if true script calls the Script Include via GlideAjax since it is a client type script
- If TRUE, g_form.setDisplay('field',true);
- 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.)