how to hide new button in portfolio form but visible in demand form

PatriciaA987250
Tera Expert

hi,

 

I need guidance to hide new button based on a specific role in a related list (List banner button) which resides in portfolio form but i need to ensure the button visible in demand form. I've tried script as below but it is not working. Can anyone guide me on how to achieve this?

 

ui action condition script

current.canCreate() && !RP.getListControl().isOmitNewButton() && RP.isRelatedList() && !RP.isManyToMany() && (gs.hasRole('portfolio_manager') && current.getTableName() == 'pm_portfolio' )  

7 REPLIES 7

Bert_c1
Kilo Patron

Hi Patricia,

 

Seems I don't understand your issue, I have one 'New' button defined for the 'pm_portfolio' table and one defined for 'dmn_demand'. Since they are separate, edit either as desired. For example, make it in-active:

 

https://<instance_name>.service-now.com/sys_ui_action_list.do?sysparm_query=GOTOname%3DNew%5Etable%3Dpm_portfolio%5EORtable%3Ddmn_demand&sysparm_view= 

 

From you screenshot, seems you want the New button removed from the "Risks" related list.

 

https://<instance_name>.service-now.com/sys_ui_action_list.do?sysparm_query=GOTOname%3DNew%5Etable%3Drisk&sysparm_view= 

 

Hi Bert,

 

Yea i want to remove the new button from the risks related list based on a speific role. Provided screenshot for your reference. Kindly advise how to hide the new button accordingly.

 

retain the new button under demand

 

PatriciaA987250_1-1728068744256.png

remove the new button under portfolio

PatriciaA987250_2-1728068880920.png

 

Update the OOB UI Action and add logic as you desire, I don't know how you distinguish tables there. 

Thank you for your input.