g_list undefined on task table ui action

AdriaM
Mega Sage

Hi all,

I want to define a UI Action over task table, and I've some kind of poltergeist.

 

When the UI Action is defined against task table it does not work (g_list is undefined). If I change task table to sc_req_item table the UI action works.

 

Someone knows what is happening?

 

The UI Action definition is as follows:

Name: Test Task UI Action

Table: task

Client: true

List v2 Compatible: true

List Link: true

onClick: testUiAction()

Script:

function testUiAction() {
    alert('tableName=>' + g_list.getTableName());
}
1 ACCEPTED SOLUTION

AdriaM
Mega Sage

We have a calculated field added to incident and sc_req_item tables that sometimes needs to be recalculated. That's why the UI Action is against task table.

This task of recalculation is an admin task so I prefer not to put it on a button.

I can't put it on a "List Choice" because with this configuration I won't be able to launch the UI action on filtered registers. "List Choices" only get enabled for checked registrers.

Until now, we have left the "List Context Menu" to User Utilities instead of admin utilities.

I see I'll have to create an UI ACtion for each table.

View solution in original post

6 REPLIES 6

@AdriaM 

yes I recommend create separate UI action on each table and then handle the logic.

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

Thanks for the update. However, UI Actions are not inherited — so it’s better to create separate UI Actions on each table, or use a Client Script, which can be inherited by child tables.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************