Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Modify format date is displayed in email

Avatar

Level 4

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?

1 Accepted Solution

Avatar

Correct answer by
Level 10

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

View solution in original post

5 Replies

Avatar

Correct answer by
Level 10

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

Avatar

Level 4

It was caused by using rawValue instead of formattedValue.

Avatar

Level 4

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

Error.png

Avatar

Level 10

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

Save As > Reader Extended PDF > Enable Additional Features

Avatar

Level 4

I thought I had, but apparently not. Thanks!