g_list not working in related list action for workspace

Dibyaratnam
Tera Sage

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.

Dibyaratnam_0-1756119771654.png

Dibyaratnam_1-1756119812954.png

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/...

 

 

4 REPLIES 4

GlideFather
Tera Patron

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! */


I am not using any GlideAjax, its not helping me.

Ankur Bawiskar
Tera Patron
Tera Patron

@Dibyaratnam 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Dibyaratnam
Tera Sage

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

 

Dibyaratnam_1-1756122904730.png