nambesal Posted July 30, 2008 Posted July 30, 2008 I am trying to use ScriptMaster to trigger scripts in my IWP solution. I have the following calculation which works properly via FileMaker 9 Advanced. Let ( [ setFileName = SMSetVariable("fileName";Get ( FileName )); setScriptName = SMSetVariable("scriptName"; "test"); setParam = SMSetVariable("Parameter"; "1") ]; EvaluateGroovy(" fmpro.performScript(fileName, scriptName, Parameter);¶return true;") ) but gives me the following error when being evaluated via IWP: com.prosc.fmkit.FmScriptException: Error 100: There is no file open named 'NMDDPC_OOG' Parameters: {fileName=NMDDPC_OOG, scriptName=test, Parameter=1, fmpro=com.prosc.beanshell.FMPro@3820e} ---Script--- Script: fmpro.performScript(fileName, scriptName, Parameter); return true; Can anyone please help?
Søren Dyhr Posted July 30, 2008 Posted July 30, 2008 Perhaps it could be beneficial to see what the called script in fact is supposed to do?? --sd
nambesal Posted July 30, 2008 Author Posted July 30, 2008 For testing I have tried to make the scripts as simple as possible. Eventually I need to be able to launch the preformScript function via an auto-calculate field, but for now I have a button that preforms the following simple script to launch the ScripMaster plug-in preformScript function and get the last ScriptMaster Error: Script Name: test4 SetField[NMDDPC_OOG::test4; Let ( [ setFileName = SMSetVariable("fileName";Get ( FileName )); setScriptName = SMSetVariable("scriptName"; "test"); setParam = SMSetVariable("Parameter"; "1") ]; EvaluateGroovy(" fmpro.performScript(fileName, scriptName, Parameter);¶return true;") ) ] Set Field[NMDDPC_OOG::test4;SMLastError] The script that i am calling using ScriptMaster simply increments the value of a field by 1(the script parameter) Script Name: test Set Field[NMDDPC_OOG::test2; NMDDPC_OOG::test2 + Get(ScriptParameter)] The code works fine within FileMaker Pro but producess the "Error: on file open named 'NMDDPC_OG'" when run via Instant Web Publishing (IWP)
Søren Dyhr Posted July 30, 2008 Posted July 30, 2008 You're not answering my question, what is the script actually performing for a task? Event triggers does not necessarily have it's obvious use in a IWP solution at all, explain what you need to workaround in the first place?? --sd
nambesal Posted July 30, 2008 Author Posted July 30, 2008 I'm trying to create an audit logging system that tracks all changes to fields in the database and put them in a separate table. I have this completely working in FileMaker Pro using auto-entry calculations, custom functions, and and the zippScript plugin to launch the script that copies the change entry into a separate table. All of this works great except for when the database is accessed via the web publishing engine (IWP or CWP). The process works like this: 1) When a field changes, a auto-entry calculation calls a custom function 2) The customs function evaluates the change and creates a audit string which holds: (table, layout, account, timestamp, field, previous value, new value) 3) The custom function then uses a script trigger plug-in (currently zippScript) to call a "Add Audit Entry" script passing the audit string as a parameter. 4) The "Add Audit Entry" script, parses out the audit sting, create a new records in the separate audit table, sets the fields in the new record based on the parsed audit string, and final return to the layout and object location prior to running the script. The issue I am having is that when the database is accessed via the web publishing engine the "Add Audit Entry" script is never processed. I believe this is because the zippScript plugin is incompatible with the web publishing engine. Thus, I am trying to use the ScriptMaster plugin to trigger the "Add Audit Enty" script since the plug in is supposed to be web engine compatible. I need an auto trigger as this process should all happen without user interaction.
Søren Dyhr Posted July 30, 2008 Posted July 30, 2008 I need an auto trigger as this process should all happen without user interaction. But the user submits or commits every change anyway, what kind of changes are we dealing with here? Not even native non IWP can monitor changes in related tables anyway. --sd
Recommended Posts
This topic is 5971 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