- 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-09-2019 06:43 AM
the table is sys_ui_view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2019 09:13 AM
I checked the table and the name of the view I placed on the view rule was correct...I still can't seem to solve this problem

- 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 🙂