2

All -

I am trying to create a custom button for the Sales console. This button is calling a specific E-Mail Template and prepopulating data.

I know how to leverage the JavaScript for Custom Buttons that bring up web pages or links for the Salesforce Console, but when I try to combine that functionality with the JavaScript to auto select a template for e-mail I get the following error:

Unexpected token ILLEGAL

Here is my code......what am I missing here?

srcUp('
     location.replace('
            /email/author/emailauthor.jsp?retURL=/{!Case.Id}&p3_lkid={!Case.Id}&rtype=003&p2_lkid={!Case.ContactId}&template_id=00XG0000001bHA9/
     ');
');
2
  • 2
    I'm exceptionally sure you can't have a newline in a literal string like this.
    – sfdcfox
    Apr 15, 2015 at 16:34
  • Are you including the integration.js script? {!REQUIRESCRIPT("/support/console/33.0/integration.js")} Apr 15, 2015 at 16:36

2 Answers 2

1

Try using following:-

srcUp("/email/author/emailauthor.jsp?retURL=/{!Case.Id}&p3_lkid={!Case.Id}&rtype=003&p2_lkid={!Case.ContactId}&template_id=00XG0000001bHA9/");

0

Try to change with this:

srcUp("
     location.replace('
            /email/author/emailauthor.jsp?retURL=/{!Case.Id}&p3_lkid={!Case.Id}&rtype=003&p2_lkid={!Case.ContactId}&template_id=00XG0000001bHA9/
     ');
");
1
  • Unfortunately this does not solve it, same error Sep 26, 2014 at 19:08

You must log in to answer this question.

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