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

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Persistent global variables in LiveCycle ES4


Level 1

Due to a very specific customer requirement, the newly created LiveCycle PDF has to have the ability to import multiple XML files without losing any data.

This is the procedure that is implemented now:

  1. User opens PDF and imports XML file
  2. Internal function is called to parse the data from the imported fields
  3. Parsed data gets written into a global variable

The above procedure is running fine. However, when the user imports another XML the whole form gets resetted and even the global variables are empty again.

Here is the import code:

var vImport, vImportData, vImportXML;

try {

    vImport = util.stringFromStream(vStream).replace(/(\<\?.*\?\>\s*)|(\<!-{2}(.|\n|\r)*-{2}\>)|(\r\n|\r|\n)/g, "");

    vImportData = eval(vImport);

    vImportXML = vImportData.toXMLString();, false, true);


    return true;

} catch (e) {

    return false;


I tried to remove the recalculate, I tried it with remerge but nothing worked.

Has anyone a suggestion?


0 Replies

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now