- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2020 09:00 AM
Hi,
I have a button on a list and I would like to display a message on the list saying how many records have been selected once I click the button:
gs.addInfoMessage(' You selected ' + numberOfSelectedRecords + ' records');
where numberOfSelectedRecords would be constructed as follows:
var checked = g_list.getChecked();
var arr= [];
arr = checked.split(',')
var numberOfSelectedRecords = arr.length;
the problem is that g_list.getChecked() is client side only. Is there an equivalent serverSide?
Thanks,
OH
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2020 09:03 AM
Hi,
Unfortunately there is no serverside equivalent of this. But what i use alternatively is a ui action which has server and client side code both, check the link below
https://www.servicenowguru.com/system-ui/ui-actions-system-ui/client-server-code-ui-action/
Using the above i use client side code g_list.getChecked(); to select the rows selected and pass them to server side to process further.
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2020 10:29 AM
Hi Hamid,
you need to handle this using GlideAjax possibly
sharing link for reference
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2020 01:23 AM