- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2016 09:25 AM
I have a checkbox and a list collector(glide_list) on a catalog item. if the checkbox is checked(true), the glide_list is visible(via UI policy). If the requestor adds items to the glide_list but then unchecks the checkbox, I want to clear the contents of the glide_list.
In the JavaScript Executor, I have run the following:
var a = g_form.getValue('IO:81332e394f2ae200b8ec7f75f110c77e');
alert(a);
var b = [];
g_form.setValue('IO:81332e394f2ae200b8ec7f75f110c77e', b);
Lines 1&2 successfully collect the contents of the glide_list and display them as a comma-separated list of sys_ids, as expected. Lines 3&4 appear to successfully set the value of the field to an empty string, however, the display values remain in the field. If I run lines 1&2 again, the alert appears to return nothing.
Additionally, I have an onSubmit client script that shows an error message if the checkbox is checked and the glide_list is empty. If I run the above code and click Submit, the error message appears, as if the glide_list is empty, even though the display values remain.
Is there another way to clear the contents of a glide_list using a client script? Or do I need to find some way to re-render the glide_list after I've cleared it out?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2017 08:24 AM
Patrick,
Here is what I did:
First, open your catalog item, right-click the window portion that holds the items you select, then click Inspect.(assuming you are using Chrome)
Look for the "name" attribute, should look something like:
name="select_0IO:81332e394f2ae200b8ec7f75f110c77e"
Copy the value of the name attribute, including "select_".
Add this code to your script to clear the values:
g_form.clearValue('<variable_name>');
g_form.clearOptions('select_0IO:71332c394e2ae212b8ec6f65f110c66e');//replace with your "select_" value
I believe the system technically recognizes the glide_list as two separate fields which is why both lines are necessary.
Hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2016 09:28 AM
This is a slush bucket variable right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2016 09:36 AM
It is a list collector(slushbucket) with the glide_list attribute.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2016 09:39 AM
Can you post a screenshot of how the variable looks?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2016 09:50 AM