- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2019 02:46 AM
Hi,
I'm trying to achieve an view rule that accomplishes the following demand:
- (gs.hasRole('real_estate_agent') && current.assignment_group == 'Real Estate'){
answer = "real_estate";}
Tickets(sc_request) that are assigned to the Real Estate assignment group and their agents should have their own view.
Is this possible to accomplish? (I know that the use of current doesn't work in view rules)
Best Regards.
Andreas
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2019 04:01 AM
Try this, i'm using something similar elsewhere to reference fields on the current form to set the view:
(function overrideView(view, is_list) {
var url = gs.action.getGlideURI().getMap();
var sysId = url.get('sys_id');
var gr = new GlideRecord('sc_request');
if (gr.get(sysId)) {
if(gs.hasRole('real_estate_agent') && gr.assignment_group.getDisplayValue() == 'Real Estate'){
answer = 'real_estate';
}
}
})(view, is_list);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2019 02:31 AM
Hi David!
Thanks for your help.
Now I have the same problem for the sc_req_item table. I tried with your solution, just changing the GlideRecord to "sc_req_item". But no luck, any good ideas?
/Andreas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2019 03:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2019 04:08 AM