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

Ankur Bawiskar
Tera Patron
Tera Patron

@AdriaM 

what's your business requirement to have that button on Task table which is top level table?

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

Dr Atul G- LNG
Tera Patron
Tera Patron

You are adding a UI Action to the Task table, which is not a good practice. The Task table is meant to be extended by other tables, and UI Actions should ideally be added to the specific table where they are required, not directly on Task.

*************************************************************************************************************
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]

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

Chaitanya ILCR
Kilo Patron

Hi @AdriaM ,

the issue is with the List Link

try changing the position of the UI action to somewhere else in the lis

ChaitanyaILCR_0-1755697536415.png

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

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.