Make New/Edit button on related list to be visible for certain role

jenny32
Tera Guru

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

9 REPLIES 9

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.


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.


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.


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


Anyone got answer for this issue, currently I am facing the same issue.