g_list not working in related list action for workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I have a related list action on change_task table, implemented as client script.
When I click on that action, in the console, I am getting the error SCRIPT:EXEC Error while running Client Script "GlideScopedScript": TypeError: Cannot read properties of undefined (reading 'getChecked').
Find the screenshot.
function onClick() {
g_form.addInfoMessage('Delete task');
g_form.addErrorMessage('Delete task');
g_form.addInfoMessage(g_list.getChecked());
}
I tried for other methods as well, but no success.
Basically I am trying to check how many records has been selected from the related list and based on that I will be doing some operation, but the very first thing is not working. Let me know if anyone has come across this and have any fix to this.
Glide List for next experience - https://www.servicenow.com/docs/bundle/zurich-api-reference/page/app-store/dev_portal/API_reference/...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Dibyaratnam,
please refer to this thread: Action Assignment Implemented as Client Script
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I am not using any GlideAjax, its not helping me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
it won't work in workspace as it's not supported.
what's your business requirement here?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
I want to check how many records user has selected after he clicks on the declarative action.
https://www.servicenow.com/docs/bundle/zurich-api-reference/page/app-store/dev_portal/API_reference/... - here it uses the g_list, not sure why you are saying it is not supported