Let me stipulate the following to save people the trouble of reminding me.
- I'm aware that WebDirect doesn't support card windows as such. (Possibly pertinent here but my problem went beyond card windows.)
- I'm also aware that a script step that opens a card window or any other type of window in FileMaker Pro 16 does not obviously fail in WebDirect: It just opens a window that, as it were, sits on top of the original window until the script closes it.
- I'm aware WebDirect can't export in mobile browser. (Not pertinent here.)
- I'm aware that WebDirect doesn't support exporting to .xlsx, .fmp12, xml. (Not pertinent here as I'm not trying to export to these formats: I'm using .cvs.)
So here's the executive summary: Only certain types of window seem to be able to perform a successful import in WebDirect.
My script looks sort of like the following.
Set variable [ $tempwindowname ; <my temp window name>]
New Window [ $tempwindowname; card window with close box and 'dim parent window']
Find some records
If [ get( systemplatform ) = 4 // webdirect ]
Export records [ "output.csv", dialog on, automatically open ]
Export records [ get(desktoppath) & "output.xlsx", dialog on, automatically open]
Close window [$tempwindowname, current file only]
Works fine in FileMaker Pro. Fails in WebDirect -- and without generating an error.
So I played with it some more after this initial experience.
First I discovered that the export worked fine in WebDirect if I simply did not create the new window (in other words, if I switched to a layout based on the source data table and did the export, then added a Go to Layout [original layout] step. At that point, I knew that my export steps were satisfactory and the problem must have something to do with the new window.
So I played with the window options.
- Card window: export fails (nothing gets exported, no file created)
- Document window: export fails
- FLOATING WINDOW: export succeeds!
I can't imagine why a floating window would work and a plain ol' document window wouldn't. Is this a bug? Is my database possessed by evil spirits? Have I been hacked by Russians?