Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

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

shailender_jaya
Kilo Contributor

Hi ,



In ui action u have condition field add this over there current.getTableName() !='Change_request' I think this will help u..



Regards,


Shailender.J


Hi Shailender,



its not working. i have read in wiki the below notes.The current object is not available for conditions on a list context menu (the List context menu check box is selected). Any use of current on these actions is ignored.



anyone get any idea on this.



Thanks


oh!! I thought u are asking about context menus...


shailender_jaya
Kilo Contributor

Hi Jan,



1)Just create another UI Action similarly on change_request table (ignore the other and just create similar ui action "assigned to").


2)in the condition field call the script include "javascript:new myScriptInclude().my_function();"


3) Script Include Code:


============


var myScriptInclude = Class.create();


myScriptInclude.prototype = {


      my_function: function() {


 


  return false;


      }


};


==============


4) This will help you to hide for change