- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2019 10:00 AM
I want a user with a certain role to be able to look at the customized task_sla list but it is not working.
The user has the role: cx_procurement_manager.
This is the script written under the view rule (CXP SLA is the name of the configured task_sla list):
(function overrideView(view, is_list) {
answer = null; // set the new view to answer
// Add your code here
if (is_list){
if (gs.hasRole('cx_procurement_manager')){
answer = 'cxp_sla'; // set the new view to answer
}
}
})(view, is_list);
//please helpp
Solved! Go to Solution.
- Labels:
-
User Interface (UI)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2019 09:22 AM
I recommend moving the answer = null to inside the else statement if possible, something like this:
(function overrideView(view, is_list) {
// Add your code here
if (is_list){
if (gs.hasRole('cx_procurement_manager')){
answer = 'cxp_sla'; // set the new view to answer
} else {
answer = null;
}
}
})(view, is_list);
Although, you can just not having the else statement as well as answer = null; altogether because answer will be set to the default view anyway, if I am not mistaken.
Regards,
Phuong
If you find my suggestions helpful, please mark it as correct or helpful to help out others as well 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2019 09:16 AM
Hello,
I have run the view rule and the script is fine.
Can you please check
- whether view name is correct
- whether there are any other view rules?
Best regards,
Boyan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2019 04:17 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2019 05:46 PM
The view rule is assigning the "cxp_sla" to answer. On the screenshot, it appears as if it's just "cxp sla"(without underscore). Change the assignment to "cxp sla"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2019 10:08 AM
I replicated an example and it does the exact same thing, the name of the view is TLF SLA and the view rule assignment is set to tlf_sla. I tried your recommendartion thoug, it didn't work...is there a table that stores de view names?
Thanks!