Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How set read only form in the popup window service portal

ramesh_r
Mega Sage

Hi All,

 

In reference fields when click on the i icon the popup window is opening. but all the fields are editable. i dont want any fields should, be editable.

How to set read only all the fields in the below popup that.

 

ramesh_r_0-1727915517911.png

 

5 REPLIES 5

Animesh Das2
Mega Sage
Mega Sage

Hi @ramesh_r ,

 

Can you please try to specify the portal to use the sys_popup view. You can set system property 'glide.service_portal.reference.use_sys_popup_view' to true.

Here is a KB that you can refer to for the system property set up, KB0823295

 

After that, 

Configure a UI policy for 'sys_user' table (in case field is referring User table) uncheck the Global checkbox to select the 'sys_popup' view there and make all the fields read-only using the UI policy action.

 

If this address your question, please mark this response correct by clicking on Accept as Solution and/or Kudos.

You may mark this helpful as well if it helps you.

Thanks, 

Animesh Das

@Animesh Das2 

 

I tried the properties but it's not working.. I want to make all the fields read-only in the popup but we cant write client script for the popup view also

Hi @ramesh_r ,

 

after the system property set up, did you write the UI policy also as suggested,

 

Configure a UI policy for 'sys_user' table (in case field is referring User table) uncheck the Global checkbox to select the 'sys_popup' view there and make all the fields read-only using the UI policy action.

 

That should have worked for 'sys_popup' view. If not then can you please share the SS of the UI policy please?

 

Also you can write On load Client script on 'sys_popup' view. That should work too. What issue are facing doing so?

A script in the UI policy can be made to set all the fields to readonly:

 

  var fields = g_form.getEditableFields();
  for (var i = 0; i < fields.length; i++) {
    g_form.setReadOnly(fields[i], true);
  }