Make New/Edit button on related list to be visible for certain role
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2017 12:53 AM
Hello Everyone,
I am trying to make New/Edit button on related list of Change Request form to be visible for change_admin role. I have written script in list control to make those buttons not to be visible when the Approval of Change is Approved and i want to make these buttons visible to change_admin even when that condition is met. I used gs.hasRole('<role_name>') in the 'Omit Edit/New condition' field, but it didn't work.
Can anyone suggest me how i can achieve this, please?
Thanks In advance!!
Regards,
Jenny
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2017 03:30 AM
Hello Harsh vardhan,
I tried with your code and it didn't work. I impersonated a user with 'change_admin' role and opened a change record where Approval=Approved, the button is still disabled and the output of the code should be that user to see that button. I think gs.hasRole() is not working.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2017 03:35 AM
can you try to reverse the answer value?
by the way condition will only work if both will fulfill the condition because i used AND (&&) operator.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2017 03:49 AM
You are absolutely correct that both the condition should be satisfied.
I impersonated a user who have change_admin role and checked for that button on change request record where approval is approved, still that button is disabled. I tried reversing the answer variable too...
I don't have a change_admin role and still that button doesn't show up even after reversing the answer variable in the script.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2017 04:02 AM
please refer the thread below. if you are trying it on your PDI , i can have look into it.
How to hide New and Edit button based on roles. Urgent!!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2024 10:49 AM
Anyone got answer for this issue, currently I am facing the same issue.