Jump to content
Server Maintenance This Week. ×

getContainerStream throws error on FMS16


This topic is 1800 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
  • Like 1
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 7 months later...

This topic is 1800 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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