Not entirely a Betterforms question, but partially

Peter Edwards:
Not entirely a Betterforms question, but partially one:
So in FMS version 20.2.1 they fixed a bug involving incorrect credentials using Perform Script On Server sessions.
It turns out that some of my serverside scripts were unknowingly reliant on this bug (I was PSOS calling a script in file A, which would then perform a script in file B which would then perform a script in file C. It turns out that all these files need to be opened in the “client” Data API/CWP session first).
my understanding is that the data API session then needs to say it wants access to files A, B, and C, and then the script itself needs to “open” those files before the PSOS script step.
Is there a setting somewhere in Betterforms to specify files to open during the session (so it can say “i want access to A, B and C”)
and how exactly is it possible to open the files, given that “Open File” is apparently not supported in the data API according to the FM script editor’s “Compatability Mode”

tl;dr: how can i PSOS scripts in multiple files sequentially from a Script Hook, without making the user wait for the script to finish? (the whole reason for PSOS is so that some semi-lengthy scripts that don’t require further user input can run without the potential timeout, while the user moves on to other things)

I believe there was a new feature that allowed for perform script on server to be called from server, but it needs to be specially enabled still. @Jason Wood may be able to confirm.

Jason Wood:
I didn’t know that Open File doesn’t work in Data API session, but you could open the file by referencing it in any way, such as by going to a layout that is based on a table in the external file. Or even just reading in the value of a global field should do it.

Stephen Dolenski: I had reported this to Claris this is really a problem hope they resolve

Stephen Dolenski:
one thought on this - ( haven’t tested for this use case ) but i’ve used it to open files for saving as XML … you declare a list of files you need open declare global variables then add add these to external file references iterate thru the files you need open then perform a script by name in each file that does not exist. I believe that would open the files cascading the credentials all files in the session of the calling script perhaps then PSOS could run with out waiting.



Stephen Dolenski:
I can confirm this logic did solve my SimpleQ logic as it used PSOS via DAPI I would think it would be true here for XML.

Peter Edwards:
ooh, that’s a nice idea, i will try that

Stephen Dolenski:
i just added this logic to a FMBF call that did break when we upgraded - and i believe it is working! Feed back is welcomed