- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2015 12:28 PM
I'm setting up a UI Action where I'll only click "List Choice". It seems like the action is run once per item chosen. What I'm looking for instead is a way to get all of the items chosen and then pass that complete list over to a UI Page.
Is that possible?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2015 08:05 PM
Ah, my bad. It's available in the UI Action condition, but not the script area.
Try this:
var uri = action.getGlideURI();
var parmID = uri.get('sysparm_checked_items');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2015 04:36 PM
Scott,
I believe this is available through the RP (RenderProperties) object.
Try the following:
// sysparm_checked_items=46e2fee9a9fe19810049b49dee0daf58,9d385017c611228701d22104cc95c371
var checkedItems = RP.getParameterValue('sysparm_checked_items') + '';
var checkedItemArr = checkedItems.split(',');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2015 04:23 PM
RP is not a valid object in the UI Action script window.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2015 08:05 PM
Ah, my bad. It's available in the UI Action condition, but not the script area.
Try this:
var uri = action.getGlideURI();
var parmID = uri.get('sysparm_checked_items');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2015 05:06 PM
Hi Scott,
I am not able to reproduce the "List Choice UI Action called once for every checked item" behavior. I've checked on recent Fuji builds, and in my own instance locally.
Where do you see this behavior?
Can you show us a screenshot of the whole sys_ui_action record, including the script?
In my tests, the function defined for the sys_ui_action gets called once. In that function, you can use g_list.getChecked().toString(); to get a list of the sys_ids of each checked record.
This is the test I'm using:
And the result:
My function got called once, and output 2 lines to the console.