You need to sign in to do that
Don't have an account?

Javascript alert on button click
I want to prevent users from being redirected when they click a button and picklist value is false.
I have a custom button on Opportunity related list on account. If the value of Account type is 'OLD', users should get an error message and not redirect the page. If it's anything else, they can be redirected opportunity.
What is the best way of going about this?
Thanks, -Ken
You can write something like
NOTE :Make sure the field api name and value are correct
All Answers
Do you need JavaScript for this? Could you just use an IF function on the button formula and redirect them to an error page? Something like this:
IF( Opportunity.Account.Type = "OLD",
<INSERT URL FOR ERROR PAGE>,
<INSERT REDIRECT URL>
)
Do you have a script example? that would be very helpful..
You can write something like
NOTE :Make sure the field api name and value are correct
Thanks a lot. Might you know the proper syntax in the situation where I have a picklist instead of a text field? Not sure how the ISPICKVAL arguments should be utilized.