Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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 by Thorsten Kaltenborn

error code 106

106
Table is missing

 

what are you passing to the script as a parameter???

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.

  • Author

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.

  • Author

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 by Thorsten Kaltenborn

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 by john renfrew

  • Author

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 by Thorsten Kaltenborn
quoting / coding

  • Author

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 by Thorsten Kaltenborn

  • 2 weeks later...

I have the same problem. Also fmpro.evaluate ( "Get ( TemporaryPath )" ) does no longer work server side.

  • 3 weeks later...
  • Author
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.

  • 1 year later...

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

I've noticed that a client running a v4 SCriptMaster plugin works OK, so going to try that on a test server later

  • Author

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

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

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

  • 7 months later...
  • Author

Hello all,

just wanted to let you know, that I could solved the issue by updating to ScriptMaster 5.2

BR,
Thorsten

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.