I need help with a script that will email a form with its data, thanks!

New Here ,
May 10, 2018

Copy link to clipboard

Copied

Greetings,

I am designing a form that will be filled out in three steps.  I have it set up to show the fields for the first person and have the second and third person's fields hidden.  When the form is signed digitally, the action will lock the fields on page one, make the fields visible on page two and then (This is the part I cannot figure out) email the form intact to the next person (hard coded) for them to complete their section.  When they sign the form it will lock the fields on page 2, make visible the fields on Page 3 and save it (yes, I have to figure this out too) in a specific location for the final person to complete and sign.  The final signature will lock the remaining fields and save the file in a new location (repeat of the previous signature script with a new location).

I have successfully created the first script to switch the fields, but when I use the script to email the form, it arrives without any data or fields for the next person.

Any direction to learn what I need to do to accomplish this would be appreciated.

Thanks to all...

TOPICS
Acrobat SDK and JavaScript, Windows

Views

177

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

I need help with a script that will email a form with its data, thanks!

New Here ,
May 10, 2018

Copy link to clipboard

Copied

Greetings,

I am designing a form that will be filled out in three steps.  I have it set up to show the fields for the first person and have the second and third person's fields hidden.  When the form is signed digitally, the action will lock the fields on page one, make the fields visible on page two and then (This is the part I cannot figure out) email the form intact to the next person (hard coded) for them to complete their section.  When they sign the form it will lock the fields on page 2, make visible the fields on Page 3 and save it (yes, I have to figure this out too) in a specific location for the final person to complete and sign.  The final signature will lock the remaining fields and save the file in a new location (repeat of the previous signature script with a new location).

I have successfully created the first script to switch the fields, but when I use the script to email the form, it arrives without any data or fields for the next person.

Any direction to learn what I need to do to accomplish this would be appreciated.

Thanks to all...

TOPICS
Acrobat SDK and JavaScript, Windows

Views

178

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 10, 2018 0
New Here ,
May 17, 2018

Copy link to clipboard

Copied

I have been working on this script that would execute when signing the first signature space on my form. 

If the script is interrupted and the console is shown, the field visibility works but it is not mailed.  If I tell it to ignore the error in preferences, the form will email but the visibility changes do not occur.

In addition to this, I have tried several different ways to get the form to create its own name before it is emailed.  the section below is as close as I have been able to come, but I get a security error.  Page1, Page2 and Page3 are fields and the other field names are widgets.

Any recommendations would be appreciated. 

====================================================================

// Set the display properties

   var f = this.getField("Page1");

      f.readonly = true;

   var g = getField("Page2");

      g.display = display.visible;

   var h = getField("Page3");

      h.display = display.hidden;

//Create filename to mail form

  • var i = this.getField("Page1.Name").valueAsString
  • var j = this.getField("Page1.ID").valueAsString
  • //this.saveAs(i + j + "Information Form" + ".pdf");

//Mail form to predetermined individual

this.mailForm({

bUI: false,

cTo: "User1@myISP.com",

cCc:  "user2@myISP.com",

cSubject: "A  Form has arrived",

cMsg: "Please review and process the attached  form."

});

=====================================================================

Once I get this part completed, I will work on the action when person 2 signs and finally person 3 would finalize the form and post the data to an excel spreadsheet.  I still have a lot to learn to get this to work, but think it will be worth the effort

Thank you - Gerald

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 17, 2018 0
try67 LATEST
Most Valuable Participant ,
Jul 17, 2018

Copy link to clipboard

Copied

In order to be able to use the saveAs method a script has to be installed on the local machine of each user. Is that possible in your case?

If not, the alternative is to ask the user to save the file under the desired name. If they don't do so you can stop the mailForm command from executing, until they do.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 17, 2018 0