OK....This should be really simple, but I must be missing something fundamental. I'm trying to close a form using a click event of a regular button. Adobe Javascript reference guide dictates the following:
var d = app.activeDocs;
for( var i in d ) d[i].closeDoc();
but.... d returns no active Docs. So that doesn't work.
I've looked in the Adobe Designer help, and the XFA 2.2 for insite but no luck.
You can use the following to close the form. The only thing you want to be aware of is that it only works when the form is opened in Acrobat or Reader (not when it is opened in a browser).
I tried this and I received a "This action cannot be performed from within an external window" dialog.
My test was within Adobe Designer.
Is it possible to close it in a browser? Self.Close; is the javascript for closing a browser, but I can't find documentation if there is an Adobe Javascript equivalance.
The app.execMenuItem("Close") works as if you are trying to close a PDF document from Acrobat using File>Close or Ctrl+W . If the document is opened in any external window (Browser,Designer,or other integrated application), this will not work.