How to change form view for the End (ess) users

Hari1
Mega Sage

Hi,

The end user with no roles is not able to see all the fields on the incident form that the itil role user can see. How can i change this?

I did see that the business rule "incident query and incident function" is preventing the ess user view.
But i need the end user to see all the incident form fields that an itil role user is able to see.

Can someone help me out with this?

Regards,

Hemanth N

 

6 REPLIES 6

Swapnil Soni1
Giga Guru

Hey Hemanth,

Please try this-

Name: Restrict View by Role

Type: System UI > View Rules

Table: Any

Description: Generally the view used on a form is controlled by either specifying the sysparm_view parameter in the url or module properties, or by inheriting the view from the previous form or list. Sometimes this does not apply, such as when opening a referenced field form from a record producer. In this case, you may want to control the view of the form based on roles. This script assumes there is a view called ess available to the current table.

Parameters:
  • view - A string containing the name of the current view.
  • is_list - A Boolean value indicating whether this is a list view.

Script:

(function overrideView(view, is_list) {
//Force non-itil users to use the ess view
if (gs.hasRole("itil"))
{return;}
if (view.startsWith("ess"))
{return;}
// do not change view if it starts with sys_ (e.g. sys_ref_list)
if (view.startsWith("sys_"))
{return;}
answer = "ess"; // set the new view to answer
})(view, is_list);


Pleasa mark correct or helpful if this works.
Thanks
Swapnil

Dhananjay Pawar
Kilo Sage

Hi,

If you want to show all fields to end use then add ITIL role to end user, He will able to see all the fields.