How to hide list context menu UI action for particular table

jananiv
Kilo Explorer

How to hide list context menu UI action for particular table. I want to hide " Assigned to" ui action for change request table. added this condition in the ui action   current.sys_class_name != 'change_request' but it didnot work for me.

Change records.PNG

Even i tried calling the below script include but not working. Please help me out his

function sample(current) {

  if (current.sys_class_name != 'change_request') {

  return true;

  }

}

 

Thanks in advance

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Jan,



I found one way. You can try and let me know


1) In left nav type visit UI Actions or UI Context menus based on what the Assign to me button is


2) Search with name contains "Assign to me"


3) In the condition field update the existing condition with current.getTableName() !='change_request'; If this doesn't work for you use current.sys_class_name != 'change_request'



Mark my reply as Correct and also hit Like and Helpful if you find my response worthy.


Thanks


Ankur


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

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Jan,



Any progress on this.


If your query is resolved please mark my answer as Correct and hit Like and Helpful.



Thanks


Ankur


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

blittle
Tera Contributor

You can do this with the UI Action Visibility related list at the bottom of a UI Action. It is specific to a view, but it will do what you want:

 

blittle_0-1708619185287.png

 

Click Edit, and choose the view that you want to show/hide the UI Action. Once you save, it will automatically choose the 'Include' Visibility, but you can list edit that to 'Exclude' instead.