Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Assigning Name to XML file

Avatar

Former Community Member
Hi Y'all,



I'd like the XML file name being submitted with "Submit via Email" button be value entered in one of the required text fields.



In current case name of the field is ClubNumber. For xample if user entered 22155 in the field, the XML file would be named 22155.xml.



How can I do that?



Thanks,




9 Replies

Avatar

Former Community Member
Donald,



As far as I know, you can not change the name of the attachment file via the email submit button.

Avatar

Former Community Member
Was afraid of that but, thanks for the quick reply.




Avatar

Former Community Member
Just revisited my form and have this additional question.



How can I add the value of a text field to the Email subject field?



Examples:

Current value in email subject field is "SCODAchievementsData"



I'd like to add value of ClubNumber field so it would look like this "SCODAchievementsData - 22155" assuming the value of ClubNumber field is "22155".



Thanks,




Avatar

Former Community Member
You can set the subject line using the ?subject= parameter in the mailto target. For example:



if (SCODAchievementsData.rawValue != null)

{

var oSubmitTarget = this.resolveNode("#event.#submit").target;

var nLoc = oSubmitTarget.indexOf("?subject=");

if (nLoc > -1)

{

var target = oSubmitTarget.substring(0, nLoc);

this.resolveNode("#event.#submit").target = target + "?subject=" + SCODAchievementsData.rawValue;

}

}

Avatar

Former Community Member
Forgot to mention, that you should use the preSubmit event of the email submit button for this code sample

Avatar

Former Community Member
David,



I don't find a "presubmit" event for the "Submit by Email" button.



Am I missing something?



Thanks,




Avatar

Former Community Member
3/4 the way down in the list of available events you have postPrint, preSubmit, docReady and docClose.

Avatar

Former Community Member
Found it!



Now must learn something about JavaScript.



Thanks for your help,




Avatar

Former Community Member
David,



I am new to Live Cycle, and only have little knowledge about JavaScript. And based on the code sample above, I am a little clueless as how to associate a particular field to the subject, which variable will stores the information in the field? I am having the same situation as Donald.



Thanks.

Jon