hide ui action button using client script

Roxi1
Tera Contributor

we have a requirement to hide ui action button form one table in some conditions 

when state is InProgress and

the logged in user is same as approver  or coordinator (approver and coordinator are two fields in the record)

or logged in user is having admin role

3 REPLIES 3

Harshal Aditya
Mega Sage
Mega Sage

Hi Roxi,

 

Instead of client script we can easily hide the button using  condition field in UI action

 

Regards

Harshal

AndersBGS
Tera Patron
Tera Patron

Hi @Roxi1 ,

 

there is no need to use client scripts, as UI policy can easily do the job by utilizing the condition builder - hence you do not need to add a script.

 

if my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

Best regards

Anders

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

Prince Arora
Tera Sage
Tera Sage

@Roxi1 ,

Please try this type of mechanism to hide/show UI action:

state==3 && (gs.getUserID != (current.approver+"" || current.coordinator+"")) || gs.hasRole('admin')

PRINCE_ARORA_0-1676475933469.png


If my answer solved your issue, please mark my answer as āœ…Correct & šŸ‘Helpful based on the Impact.