Expand my Community achievements bar.

Question on importDataObject

Avatar

Level 2

I created a button and on the click event, put this code in -

var oAttachments;

var myDoc = event.target;

var attResult;

try

{

          xfa.host.messageBox("removing data object");

          myDoc.removeDataObject("test");

          xfa.host.messageBox("removed data object");

          xfa.host.messageBox("importing data object");

          attResult = myDoc.importDataObject("test");

          xfa.host.messageBox("attResult value :"+attResult);

          xfa.host.messageBox("Successfully attached document");

          form1.Page1.num.rawValue = form1.Page1.num.rawValue + 1;

          if (form1.Page1.num.rawValue >= 1 )

          {

                    form1.Page1.Attached.presence = "visible";

          }

}

catch (err)

{

          xfa.host.messageBox("Issue attaching file!");

          xfa.host.messageBox("attResult value : "+attResult);

}

I am having a couple of issues :

1. for both removeDataObject and importDataObject, the code goes to the catch block - why?

2. when I go back into to designer this snippet of code disappears from the click event ????

FYI - I Reader Enable to document, so that is not the issue. Any thoughts?

0 Replies