Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

PDF form - email subject line = field

Avatar

Level 3

[Thread Edited By Adobe]

/*Don’t forget to meet and greet your fellow peers virtually by telling them about yourself here

Go ahead and to it now: https://adobe.ly/3eDnB4v */

 

Actual Question:

I am creating a PDF form on our intranet to be filled out and submitted via email with a submit button. All works well, but the recipients would like the subject line of the email to be info from the first field on the form so that it is easily searchable. I am using Adobe LiveCycle Designer 8.0 (also have Acrobat 8 Professional) but haven't found anywhere to edit this info.  I have read thread referencing possible solutions by utilizing javascript, but I'm not sure where to begin where javascript is concerned (not my forte).
 
Right now the form is Submitted by Email via a "Button" set to Control Type: Submit. Under the Submit tab I have set the Submit to URL field to - mailto:"emailaddress".

 

Also, the recipients mentioned that they can't see the PDF in the body of their email, instead its only an attachment. We are all using Outlook and Outlook Webmail and would like to see the PDF in the body.  Is there an easy way to accomplish this as well?
 
Any helpful suggestions would be greatly appreciated!
1 Accepted Solution

Avatar

Correct answer by
Former Community Member

You have the script set for FormCalc but that script is Javascript. In the script editor change the language dropdown (right hand side) to Javascript.

Paul

View solution in original post

65 Replies

Avatar

Former Community Member

Got it . thanks. Anyway to cause the required fields to be highlighted in not valid?

Avatar

Former Community Member

I figured all of it out. Thanks for all your help Paul!!

Avatar

Level 1

Paul your PDF attachment sample is awesome, thanks really helped me out.  I used the Fake Email button method with the drop down list and got it to work perfectly, however how can I add a Cc address after clicking the button using this method?

Avatar

Level 4

Hey Paul,

This is awesome!  Question.  I want to be able to mark an email as "rush" if a perticular date field is less than a week from today's date (the date I click the email button) I am thinking that I can use your last method of sending email where you fill in the blanks.  But what I would do is hide them and have everying defaulted and have two subject lines and depending on the date field will depend on which subject line is shown.  Problem is I don't know Java and I have no idea if this could work.  Any ideas or insight would be appreciated.

Thanks!

Jodi

Avatar

Former Community Member

There is nothing wrong with your technique but just so that you are clear

.....you have to test the date anyways and if it is less than a week you can change the subject line through code as well.

Paul

Avatar

Level 4

Thanks Paul!  The problem is my idea may be good - i just don't know how to write the code to do it.  Any chance you can help


Avatar

Level 4

Hi Paul,

I tried but I could not get it to work.  I would like if the contract term start date is less than 7 days from today that I get the RUSH email subject.  I got the original email to work but I can't get the if else to work.

Any help would be greatly appreciated.
Thanks!
Jodi

Avatar

Former Community Member

You can't simply subract two dates like you were doing .....you have to get a date object and then derive the number oif milliseconds from a set point. Once you have that then you can subtract milliseconds from milliseconds and get a difference. Then convert that back to days to get a diff. Once all that is done then you can do your test. I modified your code to show you . It is much easier in formclac but you have your current code in javascript so I did it in that language. I also added a couple of app.alerts in the if statement to make sure we were getting into the places. You also had syntax errors in the if statement as well there was no fldCC field on the form (I added one). Note that you do not need those fields to hold the values that you want tot set. Why not simply set them in the code? It woudl look like this:

oDoc.mailDoc({
bUI: true,
cTo:emaildd@host.com,
cCC: fldCC.rawValue,
cSubject:"RCARF",
cMsg:"This is the field message"});

This woudl eliminate the need for those 5 additional fields.

Paul

Avatar

Level 4

WOW!!! Thanks TONS Paul!  I had no idea.  I think it is time for me to sign up for a java script class.

Don't know how to thank you!

Jodi

Avatar

Former Community Member

Is it possible to extract the 5th example from your attachment from LiveCycle over to Adobe Pro?

This is exactly what im looking for as i already have my form set up to mailto: but i want it to also alter the subject depending on data choosen from a combobox!

Thanks in advance,

S

Avatar

Level 1

Hi Paul,

It seems that I'm haing similar problems to others on here. I've been through the examples you've created and tried to replicate them on my form but it's just not working. Could you take a look and let me know what I'm doing wrong. I just can't see it.

I've attached a copy of my form, and on the bottom of the 2nd page are the buttons I've created. I relly hope you can help I've spent so long looking at this. As you can probably guess I'm a complete novice whith this stuff.

Thanks in advance for you help, this thread is great and the work you put in is really appreciated.

you see how bad I am at this, I don't even know how to attach my form.. how can I attach my form to this post??

Avatar

Former Community Member

Hi Paul

I to am creating a PDF form to be filled out and submitted via email using a submit button. I have it working very well - however now I have the user wanting some information from the form to be put on the subject line of the email when it is sent(As an example they would like the date and time of the meeting) -  I am not sure how to do this as I am just learning how to make these forms.  I am using Adobe liveCycle Designer ES 8.2.   Thanks for your help

Avatar

Level 1

Hi Paul,

thank you for the demonstration of methods of email. Appreciated.

I have a slightly different issue - I have used the Acroform method and save the file as a static pdf and then I open the pdf in Acrobat x and save as Reader Extended PDF > Enable Additional Features, but when the email client opens up the name of the attachment has an additional Adobe Reader Acrobat Pro.pdf as an extension.

ie

filename.pdf - Adobe Reader Acrobat Pro.pdf

Very confusing!

Any help appreciated.

ps script (remove sensitive info)

Avatar

Level 10

Hi,

the additional extension is added always when you send a form without saving it before.

This behavior has finally been changed in Acrobat/Reader XI, but in previous versions you either have to save the form before mailing or you add an additional script in front of your script, to reset the dirty flag.

event.target.dirty = false;

Avatar

Level 1

Hi - thank you for the fast reponse.

I was using an action on a button to save as:

instead of going to the menu as I wanted a better user experience...

adding this to my email script worked perfectly - thank you.

Avatar

Level 1

Hi Paul,

Not sure if you're still in the forums as this is a fairly old message but this is the exact function that I'd like my Adobe Form to have with submitting the Subject=Field.  Problem is that I only have Adobe Standard 9 and when I try to open your sample (Message 24), it doesn't allow me to edit and show me the properties of the script you placed in the button.

Is there anyway that you might be able to post the script from this example?

Cheers,

Alwin

Avatar

Level 1

Thanks very much for the terrific examples document This is a great help to me. - Matt

Avatar

Level 1

I can grab it for you, Alwin....I doubt that Paul would mind.  Which of the methods are you needing a script for?

Avatar

Level 2

Thank you so much for the sample it is fantastic. I am new to LiveCycle, I was wondering is there a way to turn off the javascript window alert? When the fake email button is clicked i recieve the folowing pop up "mailto:user2@test?subject=This is the subject"

Thank you

Avatar

Level 2

I figured it out, for any newbies out there with the same problem you can comment out the following line like so in the fake email button script,

//app.alert(RealEmail.event__click.submit.target);

This will remove the alert.

Avatar

Level 2

I figured it out, for any newbies out there with the same problem you can comment out the following line like so in the fake email button script,

//app.alert(RealEmail.event__click.submit.target);

This will remove the alert.

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----