Forced view in UI View rule - advanced mode script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2024 07:03 AM - edited 03-01-2024 07:04 AM
I have a UI View Role. Unfortunately, in Advanced mode, I could not solve the problem of not being able to change the view.
My script:
(function overrideView(view, is_list) {
if (is_list) return;
var url = gs.action.getGlideURI().getMap();
var sysId = url.get('sys_id');
//access the GlideRecord of the currently viewed record
var gr = new GlideRecord('incident');
gr.get(sysId);
if (gr.company == "xyz") {
if (url.get('sysparm_view') == "xyz" && gs.hasRole("xyz")) {
answer = 'xyz';
} else {
answer = 'xyz';
}
} else {
answer = 'xyz';
}
})(view, is_list);
What is the simplest solution to make the view unchangeable?
Labels:
- Labels:
-
Multiple Versions
0 REPLIES 0