How to disable UI Action in Related List

loteodor
Kilo Contributor


Hi,

I would like to disable the UI Action 'New' on a Related List when a particular field of the main table has a specific value.

Have a look at the screenshot below here (in red the Ui Action).

I have a table 'Budget' with a related List of 'Budget Item' (or cost items) and I would like to disable the UI Action 'New' when the field Budget Sottomesso is equal to 'Si',   namely the budget has been submitted.

Thank you,

LorenzoMod Budget.png

19 REPLIES 19

darshanr
Kilo Guru

Hi Lorenzo,



You can right click on Related List Table : Personalize >>List Control


And you can Omit "New" or "Edit" button by   below image:


find_real_file.png


And then update the List Control.You will be able to hide even by Roles.



Thanks,


Darshan


Thank you,



though I would like to omit the UI Action when a the particular condition is reached, namely Budget Sottomesso is equal to 'Si'. With your method I am disabling the UI Action forever (the field Budget Sottomesso has the text in blu in the screnshot).


Hi Lorenzo,



Since I see only one related list in your screenshot, you can put the below code in an onLoad client script on the main table to achieve this:-



function onLoad() {


              var val=g_form.getValue('u_budget_sottomesso');// pls check the column name for this field, I just guessed it


              if(val=='Si'){


      document.getElementById("sysverb_new").style.display='none';


}


              }



Thanks & Regards,


Hari


No way to do it through Service Now without writing a script?   Just to know ...