Skip to main content
mj1904
Known Participant
January 15, 2019
Question

Customizing an email Subject line with field from .pdf form

  • January 15, 2019
  • 1 reply
  • 1508 views

I found a couple of discussions that previously described how to do this using Java script which I am not fluent in. I tried to use the commands as given but I'm getting an error message when I try to save the instructions in Adobe Acrobat. I code I used was:

var emailSubject = "Certificate " + TextField1.rawValue + ".pdf";

event.target.mailDoc({

                    bUI:        false,

                    cTo:        to,

                    cCC:        cc,

                    cSubject:   emailSubject,

                    cMsg:       emailMsg,

                    cSubmitAs:  "PDF"  

            });

The error message I get is Reference error: invalid assignment left-hand side 1: at line 2 (and it highlights line 2)

Any thoughts as to what I am doing incorrectly and how to fix?

Thanks.

var emailSubject = "Certificate " + TextField1.rawValue + ".pdf";

event.target.mailDoc({

                    bUI:        false,

                    cTo:        to,

                    cCC:        cc,

                   cSubject:   emailSubject,

                    cMsg:       emailMsg,

                    cSubmitAs:  "PDF"  

            });

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
January 15, 2019

Is this an Acrobat form or a LiveCycle Designer form?

mj1904
mj1904Author
Known Participant
January 15, 2019

Acrobat

try67
Community Expert
Community Expert
January 15, 2019

Then change this line:

var emailSubject = "Certificate " + TextField1.rawValue + ".pdf";

To:

var emailSubject = "Certificate " + this.getField("TextField1").valueAsString + ".pdf";