How can the view of a reference field be set to "READ ONLY"?

Salah2
Tera Contributor

Hi all, 

Created custom application with new table extending from Case table.  

 

I also created a Catalog Record Producer within the custom table.

Requirement: The record producer maintains three reference fields, and I need to set the reference field view to read only for anyone who is not Admin.

Reference tables: 

- Contact [customer_contact]

Salah2_1-1723044210873.png

- User [sys_user]

Salah2_0-1723044175680.png

- Team [x_team_score]

Salah2_2-1723044295379.png

Does anyone know how I can configure these reference field views and set them to "Ready-only"?

 

I am in need of urgent assistance and feeling stuck. Your help would be greatly appreciated. Thank you.

2 REPLIES 2

SN_Learn
Kilo Patron
Kilo Patron

Hi @Salah2 ,

 

Please check the below working solution:

How can I remove information icon from a reference variable in portal. 

Hide referenced popup in new Service Portal 

How to hide reference variable (Information icon) on Catalog items in Service portal 

 

 

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

Jordan Vignoni
Tera Guru

You can create a Catalog UI Policy with no conditions, and apply a script in "Execute if true".  For example, if you wanted to make the "Requested by" reference field read only for everyone except the admin role, you would use:

function onCondition() {
   if (g_user.hasRoleExactly('admin')) {
       g_form.setReadOnly('requested_by', false);
   } else {
       g_form.setReadOnly('requested_by', true);
   }
}