Expand my Community achievements bar.

Internal error when using doc.importXFAData

Avatar

Level 1

I have a XFA form created in LiveCycle (not by me)... and I've created a custom menu item that exports a .xml file upon clicking.

I've created a second menu item that imports a specific xml file into the report, however it is returning "An Internal error occurred"  BUT it also properly imports the data too.

There are 3 folder level trusted javascript functions being used in order to do this. I have 2 specific questions:

1) Can you spot why I'm getting an error using the code below (import.js)?

2) Is it possible for Acrobat to "wait for" an xml file to be created on the desktop before importing automatically. Ideally I'd only create one menu item which performs two functions: exports the xml file and then WAITS until a specifically-named .xml file appears in a given directory, before automatically importing it into the form.

Thanks a lot.

CODE:

1) menu.js (creates two menu items, Export and Import).

app.addMenuItem({cName:"Export", cParent:"Edit", cExec:"event.target.myTrustFunct(event.target)"})

app.addMenuItem({cName:"Import", cParent:"Edit", cExec:"event.target.myTrustFunctTwo(event.target)"})

2) export.js (working without errors)

var myTrustFunct = app.trustedFunction(function(doc)

{

     app.beginPriv();

        doc.exportXFAData({

          cPath:"/c/Users/ME/Desktop/savedForm.xml",

   bCopy: true,

          bPromptToOverwrite: false,

          bXDP:false

                  });

     app.endPriv();

     return;

});

3) import.js (causing error despite successful import)

var myTrustFunctTwo = app.trustedFunction(function(doc)

{

     app.beginPriv();

  doc.importXFAData({

          cPath:"/c/Users/ME/Desktop/Filled_In.xml"

                  });

     app.endPriv();

});

1 Reply

Avatar

Level 1

Bump.... The issue only occurs on my Windows 7 64-bit machine running Acrobat Pro 11.0. It runs fine on XP with Acrobat Standard 11.0.

What could be the issue?