- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2016 07:02 AM
Hi All,
I'm trying to hide "Edit" in the change task related list by using advance script in list control for people without change_manager role and also there is an OR condition with respect to state.
Please review my code,
var answer;
if(gs.hasRole == "change_manager" ) || (parent.state=='3' || parent.state=='4' || parent.state=='-2' || parent.state=='-13' || parent.state=='-14' || parent.state=='2' || !parent.active;)
{
answer=false;
}
else{
answer=true;
}
But what happens is the EDIT button is not visible to anyone with any role except ADMIN i even revoked all changes but the EDIT button is missing from the related list.
But NEW button is visible to Users
Can someone help me debug this issue.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2016 09:24 AM
The change_task table should be editable to the user. Make sure the MPI
Change Manager has write access to the table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2016 08:14 AM
As per the condition. The MPI change manager will NOT have access to the
Edit button.
Sent from my iPhone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2016 08:23 AM
As I mentionned above, you want to display the button to somebody with change_manager role, ThereFore the answer output shoud be true if you have gs.hasRole(change_manager') under your if statement
Either it is something like
if(gs.hasRole("Change Manager") || parent.state=='3' || parent.state=='4' || parent.state=='-2' || parent.state=='-13' || parent.state=='-14' || parent.state=='2' || !parent.active) {
answer = true;
} else {
answer = false;
}
OR the following :
if(!gs.hasRole("MPl Change Manager") || parent.state=='3' || parent.state=='4' || parent.state=='-2' || parent.state=='-13' || parent.state=='-14' || parent.state=='2' || !parent.active){
answer = false;
} else {
answer = true;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2016 08:43 AM
Really Appreciate for the quick response.
i just copy pasted the same code and tried but it didn't hence at least i want to show the EDIT button to users with role MPI Change Manager so i tried below code but it doesn't work.
if(gs.hasRole("Change Manager"))
{
answer = true;
gs.log('Inside if List Control EDIT');
} else {
answer = false;
}
But i see that log is getting updated in the script log statements.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2016 09:24 AM
The change_task table should be editable to the user. Make sure the MPI
Change Manager has write access to the table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2016 04:21 AM
Hi Santosh,
I have created a write ACL for change_task table with this role.