Modify format date is displayed in email

Avatar

Avatar

Syrax12

Avatar

Syrax12

Syrax12

17-02-2015

I'm using the following script to customize the email submission of a form:

var oDoc = event.target;

oDoc.mailDoc({

bUI: true,

cTo: "user@company.com",

cSubject: "New CCR Form submitted on " + CurrentDate.rawValue + " by " + teamLead.rawValue,

cMsg: teamLead.rawValue + " has submitted a new Change Control Request form."+"\nPlease review and complete the Impact Assessment section, and if approved, submit to the IT Manager for further approval.\n\nREQID:"  + REQID.rawValue + "\nDue Date: " + dueDate.rawValue + "\nPriority: " + priority.rawValue,

});

It runs fine and formats the email as expected, the only issue I have is how the date is displayed in the email. The CurrentDate.rawValue in the subject line displays how I want it to, e.g. 02/17/15, but the dueDate.rawValue displays as 2015-02-17, even though the pattern setting in the document is mm/dd/yy and displays correctly in the form itself. Any idea why the date is changing it's display pattern when generating the email and how to fix it?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Magus069

MVP

Total Posts

1.0K

Likes

132

Correct Answer

150

Avatar

Magus069

MVP

Total Posts

1.0K

Likes

132

Correct Answer

150
Magus069
MVP

17-02-2015

Hi there,

I am not sure if that could cause an issue, but does both fields have a display and edit pattern??

Sometimes an error is caused because there is no edit pattern for date fields...

Otherwise, you could also have the display pattern you wish to display in the email for both fields and have the formattedValue instead of the rawValue

Hope this help

Answers (4)

Answers (4)

Avatar

Avatar

Magus069

MVP

Total Posts

1.0K

Likes

132

Correct Answer

150

Avatar

Magus069

MVP

Total Posts

1.0K

Likes

132

Correct Answer

150
Magus069
MVP

18-02-2015

Have you enabled "Reader Extensions" for the PDF in Adobe Acrobat Pro?

Save As > Reader Extended PDF > Enable Additional Features

Avatar

Avatar

Syrax12

Avatar

Syrax12

Syrax12

18-02-2015

I thought I had, but apparently not. Thanks!

Avatar

Avatar

Syrax12

Avatar

Syrax12

Syrax12

17-02-2015

Well, new problem Magus069‌, When users access the form, they get this error when trying to submit:

Error.png

Avatar

Avatar

Syrax12

Avatar

Syrax12

Syrax12

17-02-2015

It was caused by using rawValue instead of formattedValue.