
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2022 03:51 AM
In the Self-service portal I'm allowing the user to select a laptop from a select lookup box. Once they select it, I have a UI policy script execute which updates the rich text label below the select lookup box. This works fine but only works once. If they select a different item in the lookup box the script doesn't execute again. If they move it back to "--none--" and then make another selection it works again.
It appears the UI policy conditions only check when the user changes it from nothing to something. If you change from something to something it doesn't fire. Any ideas?
function onCondition()
{
var choiceValue = g_form.getValue('which_laptop');
var gr = new GlideRecord('pc_product_cat_item');
gr.addQuery('short_description', choiceValue);
gr.query(findRecord);
function findRecord(gr)
{
while (gr.next())
{
g_form.setLabelOf('selected_item',gr.description);
}
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2022 03:58 AM
Put your code in an on change client script , where your field should be your lookup select box.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2022 03:58 AM
Put your code in an on change client script , where your field should be your lookup select box.
Raghav
MVP 2023

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2022 04:05 AM
Hi there! Client scripts are attached to tables correct? Which table would I connect the script to if someone is trying to order an item in the portal like I've shown above?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2022 04:12 AM
It will be a catalog client script attached to the catalog item in which the UI policy exists.
Raghav
MVP 2023

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2022 04:17 AM
You're the best! Thanks this worked, I can't believe I didn't think of it.