- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 08:17 AM
Hello Community!
Is it possible to script a catalog UI policy based on the selection in a reference variable? The design I'm trying to achieve is like this:
- Reference variable on sys_user "who is the employee involved?"
- User selects the employee
- If employee.userField == X, expose additional variables
Can a UI policy of this sort be scripted?
If so, should I be concerned about performance implications of a real time check against the user record field?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 08:27 AM
Sample script
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var ref = g_form.getReference('<user reference var name>', usrObj);
}
function usrObj(ref) {
if(ref.<X> == <whatever>)
//show variables
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 08:26 AM
Hi,
You cant dot walk in UI Policy Conditon.
But you can achieve the same using a catalog Client script which runs on change of User Variable.
You can check the user attribute using Glide Aajx or GetReference
And based on that you can make other variables visible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 08:27 AM
Sample script
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var ref = g_form.getReference('<user reference var name>', usrObj);
}
function usrObj(ref) {
if(ref.<X> == <whatever>)
//show variables
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2024 03:58 AM
Thank you for these configuration details and the example script! This is exactly what I needed.