I have a custom Opportunity list button. I have placed this button on the Opportunity related list on the contract record.

The JavaScript is:


I am returning this error when I click the button:

A problem with the OnClick JavaScript for this button or link was encountered: Syntax error in regular expression

I don't see anything wrong with this snippet. Can you advise?


1 Answer 1


You made the button the wrong type. You should be redirecting to a url rather than executing Javascript.

  • Thank you! I changed it to a URL instead of having it execute JavaScript. Sep 14, 2015 at 10:24
  • @AndyHitchings No problem. Glad to help.
    – martin
    Sep 14, 2015 at 10:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .