"Close Window" runs before Export Completes

Discussion created by sleepy62 on May 7, 2018
Latest reply on May 7, 2018 by sleepy62

I have a situation where I need to export a container contents from a web direct page then immediately close the window. The basic sequence works and exports properly but Im finding that if I have a "Close Window" after the export  statement it will execute before the export has a chance to finish and no file is exported. This seems like a bug to me.


The workarounds I can think of are insert a pause, but that seems unreliable, or directing the user to a special page and making the user close the window.


Wondering if anyone has found a better solution to this.


Here is the basic script:


Go to Layout [ “Docs” (Docs) ; Animation: None ]

Enter Find Mode [ Pause: Off ]

Set Field [ Docs::c_Docnum_rev ; Get(ScriptParameter) ]

Perform Find []

Export Field Contents [ Docs::Doc_PDF_Container ]

Close Window [ Current Window ]