Avatar

Level 10

Hi Trang,

Paul would be better help here...

..but I think there are a few things going on here.

In Paul's original script "var sFile = myFile" + NumericField1.rawValue;" is to assign a bound variable to the attached file. So while the listbox displays the actual file name, it has a hidden bound value eg "myFile0".

So the other buttons/scripts are not accessing the file name of the attachments, but the bound values.

So your script "var sFile = "/C/ARP/Sample_Plot_Report";" will not work.

If you want to determine the actual file to be attached you could try adapting this variable:

var sFileName = myDataObject.path; //by setting a set path to the file

However I strongly suspect that the importDataObject is going to open the browser/explorer dialogue.

The import data objects is not a privileged function (afaik). So you don't need to develop a javascript folder level file. I think you are going to be stuck with the dialogue opening up each time the button is clicked.

When the attachment opens it will be in a new window. You will not be able to add pages from other documents into an XFA form.

Hope that helps,

Niall