Hide the specific fields in preview record.

Ashok32
Tera Contributor

Hi,

I have a Requirement like 

if the User having admin Role then he/She can only able to see the Specific fields in the Preview the Record.

 

Can any one help me how can i achieve this .

 

Thanks in Advance.

1 ACCEPTED SOLUTION

Gunjan Kiratkar
Kilo Patron
Kilo Patron

Hi @Ashok32 ,

 

Create a new view with name "sys_popup"

and configure form layout for that reference field table.

Then create view based client script / ui policy to hide or show the fields based on condition.

Reference :-

Hide field on open record preview 

How to hide Variables from RITM Preview? 


Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy

View solution in original post

5 REPLIES 5

Hi @Ashok32 

You can create UI policy or client script on view based.

Just uncheck globle checkbox from client script writedown view name as 'sys_popup'.

And then in script check role as below 

If (g_user.hasRole('admin')) {

//Code

}


Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy