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

I am afraid you will have to write a client script on main table/ a server code in the list control



Thanks & Regards,


Hari


Hi Hari,



List Control will apply only for specific table where Related List is present.


I think your way of Client Script might interefere with Other New button in form as "New" is global UI Action



Thanks,


Darshan


Not like that Darshan, as I mentioned in my first post, since there is only one Related List on his form and just one New button, it only impacts that. Incase there are multiple related lists and multiple New buttons, we can always index it and hide the appropriate one. But I do agree that rather than a client script, its better to put the code in the list control only



Thanks & Regards,


Hari


This is a possible solution to hide customized UI Actions.



I formerly used the "listEditRefQualTag variable used as a member API for getListControl() in related list UI action's condition" - solution


to hide these buttons, but this does not work any more since Jakarta.



Another possibility would be to use "Control UI action visibility with views"


https://docs.servicenow.com/bundle/helsinki-servicenow-platform/page/administer/list-administration/...


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Lorenzo,



I hope the below links will be helpful


» How to Remove Form Buttons and Disable Context Menus


» Related lists Archives



i hope this helps



Thanks,


Pradeep Sharma