Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

UI Policies Script

Gaurav69
Tera Contributor

I want if the logged-in user is an admin then the 'closed' choice in the 'state' field of the incident form should not be visible.

2 ACCEPTED SOLUTIONS

Anurag Tripathi
Mega Patron

Hi,

Try the below in an onload client script  (keep the ui type as all)

 

if (g_user.hasRole('admin')) {
   	g_form.removeOption('state', '3'); // valiue for closed, chjange the value if you have somehting different
     }

 

-Anurag

View solution in original post

Dhananjay Pawar
Kilo Sage

Hi,

There are two option to achieve this.

1) UI Policy

DhananjayPawar_0-1710495783640.png

 

2) Client script

DhananjayPawar_1-1710495940320.png

 

Thanks.

 

 

View solution in original post

2 REPLIES 2

Anurag Tripathi
Mega Patron

Hi,

Try the below in an onload client script  (keep the ui type as all)

 

if (g_user.hasRole('admin')) {
   	g_form.removeOption('state', '3'); // valiue for closed, chjange the value if you have somehting different
     }

 

-Anurag

Dhananjay Pawar
Kilo Sage

Hi,

There are two option to achieve this.

1) UI Policy

DhananjayPawar_0-1710495783640.png

 

2) Client script

DhananjayPawar_1-1710495940320.png

 

Thanks.