Thorsten Kaltenborn Posted July 27, 2017 Posted July 27, 2017 (edited) Hi there! I have installed ScriptMaster to Filemaker Server 16 under Windows Server 2012 R2 If I use getContainerStream in a server script I get an exception: Quote try{ container = fmpro.getContainerStream(<containerFieldName>); } catch(e) { return e; } Returns com.prosc.fmkit.FmCalculationException: 106 The containerField is defined as external / open. Exporting the content using Export Field Contents works fine. This worked fine before updating from Filemaker 14. Am I missing something? Regards, Thorsten P.S.: Same error occurs on fmpro.getContainerFileName Edited July 27, 2017 by Thorsten Kaltenborn
john renfrew Posted July 27, 2017 Posted July 27, 2017 error code 106 106 Table is missing what are you passing to the script as a parameter???
ryan360Works Posted July 27, 2017 Posted July 27, 2017 Since this is a server side script, you also need to make sure you are providing context in your script so that when you pass in the container to your function you are on a layout where that field exists or at least on a layout of a related table. If you are calling this from an unrelated table I could see this error occurring.
Thorsten Kaltenborn Posted July 28, 2017 Author Posted July 28, 2017 This a Filemaker error number? Have not thought of that. Unfortunately I am using a layout of exactly that needed table. The server script switches to the layout and searches for the record which is passed a script parameter. If found it passes the name of the container field to the groovy script. The container field itself is part of the table, not a referenced one. As I mentioned before, the script worked fine before switching from Filemaker Server 14 to 16 (I had to change the server, too). I will try to make a new (and smaller) database in which I can show you the behavior.
Thorsten Kaltenborn Posted July 31, 2017 Author Posted July 31, 2017 (edited) OK, I made a simple test file which only contains the faulty functions. I also enclosed the 360Plugins_Server.log Maybe you can see, what goes wrong. I work on Windows Server 2012 R2. The password for admin is admin SM-Test.zip BTW: I realized, that the last command in the groovy script is wrong, but this is not the real fault Edited July 31, 2017 by Thorsten Kaltenborn
john renfrew Posted July 31, 2017 Posted July 31, 2017 (edited) Doesn't work because of this: Get ( DocumentsPath ) the path you pass to any SM function needs to be a correct O/S path not the FileMaker version of that... The raw path I get back from my Server 16 is: /C:/Program Files/FileMaker/FileMaker Server/Data/Documents/ setVariable $thePath = Substitute ( Middle ( Get ( DocumentsPath ) ; 2; 999 ) ; "/" ; "\\" ) will work, then use it in the function call and you are appending the FILENAME to a new file not it's contents with this - f.append ( container ) try this? // SaveContainerAsFile ( fm_field ; fm_fileOut ) // v1.0 // J Renfrew // fm_field = FQFN of container field // fm_path = fullOS path and filename f = new File( fm_fileOut ) if (f.exists()) { if (!f.delete()) { //throw new IOException('Could not delete ' + f.getAbsolutePath()) return 'Could not delete ' + f.getAbsolutePath() } } try { f.append( fmpro.getContainerStream ( fm_field ) ) } catch (e) { return e.getMessage() } return true Edited July 31, 2017 by john renfrew 1
Thorsten Kaltenborn Posted August 2, 2017 Author Posted August 2, 2017 (edited) Dear John, thank you for your help. You are right, new File would not work with this path. Unfortunately this isn't my real problem because I still get error 106 even if I comment out the whole export part of the function leaving only // SaveContainerAsFile( fm_field )" ; try { inData = fmpro.getContainerStream ( fm_field ) } catch (e) { return e } return true So the error is somewhere else. Edited August 2, 2017 by Thorsten Kaltenborn quoting / coding
Thorsten Kaltenborn Posted August 3, 2017 Author Posted August 3, 2017 (edited) Today I read, that FM 16 has new security options. Maybe I can find the answer there? @John: Did you test my file on your server? Did it work for you? Edited August 3, 2017 by Thorsten Kaltenborn
andries Posted August 14, 2017 Posted August 14, 2017 I have the same problem. Also fmpro.evaluate ( "Get ( TemporaryPath )" ) does no longer work server side.
Thorsten Kaltenborn Posted August 30, 2017 Author Posted August 30, 2017 On 14. August 2017 at 0:23 PM, andries said: I have the same problem. Also fmpro.evaluate ( "Get ( TemporaryPath )" ) does no longer work server side. Hi Andries, did you find a solution? Was on vacation so I didn't had time to investigate any further.
AlanTrewartha Posted September 27, 2018 Posted September 27, 2018 Just a me too on this - exact same server config (win 2012R2, FMS 16, Master 5.09). In case anyone is still looking in and has made progress. I can't upgrade to server 17 - just yet - and wondered if anyone else had figured out what was up with fmpro.getContainerStream and other fmpro methods
AlanTrewartha Posted September 27, 2018 Posted September 27, 2018 I've noticed that a client running a v4 SCriptMaster plugin works OK, so going to try that on a test server later
Thorsten Kaltenborn Posted September 27, 2018 Author Posted September 27, 2018 Hi Alan, 7 minutes ago, AlanTrewartha said: I've noticed that a client running a v4 SCriptMaster plugin works OK, so going to try that on a test server later in my case client version 5.x works fine, too. Only the server version can't access the container. Regards, Thorsten
AlanTrewartha Posted October 4, 2018 Posted October 4, 2018 Yes, I've managed to check it works on my client with v4 and v5, but NOT v5 on the server, and I know it DID work with v4 on an older (FMP11) server
john renfrew Posted October 4, 2018 Posted October 4, 2018 It is an issue that 360works are aware of, and as I far as I know working on... It affects my work quite significantly, especially now that the older versions do not install on FMS!7
Thorsten Kaltenborn Posted May 23, 2019 Author Posted May 23, 2019 Hello all, just wanted to let you know, that I could solved the issue by updating to ScriptMaster 5.2 BR, Thorsten
Recommended Posts
This topic is 2354 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now