You need to sign in to do that
Don't have an account?
sudhirn@merunetworks.com
Validation on Role can be assigned to only one user
Hi,
We have two 3 roles ( Finance Approver , GHC Approver , Program Administrator ) This can be assinged to only one user it cannot be assigned to multiple users we want to add a validation rule if this role is already assigned need to display a message in user screen please suggest me how to write this validation rule
Thanks
Sudhir
We have two 3 roles ( Finance Approver , GHC Approver , Program Administrator ) This can be assinged to only one user it cannot be assigned to multiple users we want to add a validation rule if this role is already assigned need to display a message in user screen please suggest me how to write this validation rule
Thanks
Sudhir
Try with below code !
Let me know if it helps !!
Thanks
Manoj
All Answers
Use trigger.
www.infallibletechie.com
Yes it is correct that this i snot possible in Validation rule .You need to write trigger ,You have to write trigger for before insert and updat eto check this validation .
You can try with below trigger it will help you to solve your problem .
Let me know if it helps !!
Thanks
Manoj
I tried your method but UserRoleId column do not exist in userrole object I tried modifiing the code but no luck its not working
Please suggest me how to change the code.
Thanks
Sudhir
Try with below code !
Let me know if it helps !!
Thanks
Manoj
Thanks Manjo It worked can you please help to prepare test class for the trigger you created this would be great help for me
Thanks
Sudhir
Please try with below trigger and test class !!
Let me know if it works !!
Thanks
Manoj
My scenario is for certain Roles(say VP,Marketing) there should be only one user assigned. we can restrict user creation by triggers but how can i achieve this while assigning the user in Role hierarchy. If i assign more than one user in the Role Hierarchy and while saving, it should display an error message here also.
Kindly give me some pointers on how to achieve this.
Thanks,
Raj