Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Submitted PDF file renamed on submission.

Anonymous
Not applicable

Hi all,

I've created a form through designer which is used with our Companys IT Helpdesk system. In the form I have used a regular button with a click event to submit the form through either Adobe Reader or Pro.

The filename is Company New Starter Application Form.pdf

The problem i have is that when the form is submitted, for example with Acrobat Pro the filename is changed to

Company New Starter Application Form.pdf - Adobe Acrobat Pro.pdf

This renaming of the file is subsequently causing problems with our helpdesk system where it is stripping out the PDF file likely due to the unconventional renaming of the file.

Below is the script from this click event:

if (form1.execValidate()) {

var oDoc = event.target;

xfa.host.messageBox("Thank you for completing the New Joiner form. Please check that all ADDITIONAL FORMS have been completed and submitted where requested. This submission will now be sent to IT Security. Please note, due to Outlook security precautions, you may be required to click on 'Send' when the email is generated. For your records a copy of this request will be stored in your Outlook Sent Items.", "SUBMISSION NOTICE", 3);

oDoc.mailDoc({
bUI: false,
cTo: "*********@******.co.uk",
cSubject: "Aspen New Joiner: " + Page1.firstname.rawValue + " " + Page1.lastname.rawValue + " (Starting: " + Page1.StartDate.rawValue + ")",
cMsg: "Please find attached the completed New Joiner form for " + Page1.firstname.rawValue + " " + Page1.lastname.rawValue,
});

}
else
{
SetFocusOnFirstFailedField.DoSetFocusOnFirstFailedField(form1);
}

I tried adding  event.target.dirty = false; to the beginning of the script which worked as in it prevented the file from being renamed, however it subsequently stripped out all entered onto the form once submitted.

Any help would be great. Am I doing something wrong??

Thanks.

1 Reply
radzmar
Level 10
Level 10

Hi,

you can try to put the code snippet event.target.dirty = false; into another event or a separate function you call before you execute your email script.

I noticed that the the form data won't be submitted if snippet is used within another script, but if it is executed separately before.