View rule for change request for specific group to make default view

Chaithu3
Tera Contributor

Hi Experts,

 

The view for change form should be default to Default view for all the users, But the user from specific group X should be able to change the view but remaining all users including admin(if not part of X group) should not allow to change the view in form and list.

I have created a role called "ViewRoleChange" and assigned to X group.

Below is the code which i tried, Please help me ASAP with Fix,

 

(function overrideView(view, is_list) {
    var url = gs.action.getGlideURI().getMap();
    var sysId = url.get('sys_id');

    //access the GlideRecord of the currently viewed record
    var gr = new GlideRecord('change_request');
    gr.get(sysId);

    if (!gs.hasRole('ViewRoleChange')) {
        answer = "Default";
    }

})(view, is_list);
 
 
Thanks in advance.
Looping @Ankur Bawiskar 
 

 

6 REPLIES 6

Pankaj kr
Kilo Sage

Hi @Chaithu3 ,

 

You can use navigation handler for this.

Refer this article for more info: NavigationHandler 

 

Please mark as helpful if it solved your issue as doing so will help others also.

 

Thanks.

Hi @Chaithu3 ,

 

If you the proposed solution fixed your issue, please mark the solution as accepted to help others and mark this question as answered.

 

Thanks,

 

Pankaj Kumar