You need to sign in to do that
Don't have an account?
Mubarak Hussain 1
Validation rule in Opportunity button
Hi all,
How to write a validation rule for button in Opportunity.
For ex:am having close opportunity button in Opportunity.Now i want only dealer user need to close the opportunity.if any one try to close it need to throw error.
I used apex class but am not getting.
Thanks
How to write a validation rule for button in Opportunity.
For ex:am having close opportunity button in Opportunity.Now i want only dealer user need to close the opportunity.if any one try to close it need to throw error.
I used apex class but am not getting.
Thanks
As per your requirement you have a custom button on oppportunity name is Close Opportunity and you want that if some user want to close the opportunity then they can do and for remaing you want to get some error message . so write the javascript on your custom button like this:
in this javascript use the alias name of the user for that you want to get the error message.
Thanks
Gynai
Other option for you is to simply have a validation rule.
Example:
AND(ISCHANGED(StageName), OR(ISPICKVAL(StageName, 'Closed Won'), ISPICKVAL(StageName, 'Closed Lost')), $Profile.Name != 'NAME_OF_DEALER_USER_PROFILE')