Can we get the related list sysID in Ui action script

sri vyshnavi
Tera Expert

I need to get the related list sysid in the Client UI action Script so that based on it I can do my functionality. 

 

1 ACCEPTED SOLUTION

g_list.getTableName() is returning the TableName not the sysid. 

g_list.getTitle() is getting the Name of the related list. This helped resolve my issue

View solution in original post

2 REPLIES 2

Sayali Gurav
Tera Guru
Tera Guru

Hello,

In ServiceNow, if you're working with a Client UI action script and you need to access the related list sysid, you can use the g_list variable. This variable provides access to information about the related list.

Here's an example of how you can retrieve the related list sysid in a Client UI action script:
javascript
function yourClientActionFunction() {
var relatedListSysID = g_list.getTableName(); // This will give you the sys_id of the related list
// Your functionality using the related list sys_id goes here
}
In this example, g_list.getTableName() retrieves the sys_id of the related list. You can then use this sys_id to perform your desired functionality.

Remember to replace yourClientActionFunction with the actual name of your function, and customize the functionality based on your specific requirements.

 

Please mark helpful or correct if applicable.

Thanks & Regards,

Sayali Gurav

g_list.getTableName() is returning the TableName not the sysid. 

g_list.getTitle() is getting the Name of the related list. This helped resolve my issue