How to format Data in subject line of an Email

Avatar

Avatar
Level 1
Curtman1979
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
Curtman1979
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
View profile
Curtman1979
Level 1

21-04-2015

I have an email submit button on my LiveCycle form and the client wants data from the form in the subject line of the email. I have the button set up and the patterns set up on the fields but the data in the subject line doesn't display the way it does in the fields. this is what I have.

var oDoc = event.target;

var nSubject = Page1.Top.txtEmpID.rawValue + " " + Page1.Top.dteTo.rawValue;

oDoc.mailDoc({

cTo: "first.last@gov.ab.ca",

cSubject: nSubject,

cMsg: Page1.Top.txtLastName.rawValue + " " + "Performance Agreement"

});

The Employee ID is 7 digits including leading zeros (0123456) and the date is formatted MM-DD-YYYY. When it goes to the subject line it doesn't show the leading zeros (123456) and the date is formatted YYYY-MM-DD.

Any help is appreciated, Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

Avatar

Avatar
Level 1
Curtman1979
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
Curtman1979
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
View profile
Curtman1979
Level 1

21-04-2015

Thank you, that worked.

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

397 likes

Total Posts

2,687 posts

Correct reply

492 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

397 likes

Total Posts

2,687 posts

Correct reply

492 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

21-04-2015

To get the formatted date striong use formattedValue instead of the rawValue in your scriptings.