June 24, 20169 yr Hello all So I'm pretty new to Filemaker and CWP - I have created a form which people fill out and it stores the data in a filemaker solution. The idea being a script is then run which will notify a user if the form has been submitted. Now I have the script for that and all the Filemaker side completed, as well as the data entry from the PHP form, but I am really struggling with running a script with a parameter... It runs the script, but not the parameter attached. For a bit of context, Someone fills out the form and it is entered into the database, a script is then called with the parameter being an ID, the script then checks the ID with the parameter ID and then sends a notification to the user with the details from the record where the IDs match... but it will not pass the ID parameter into the script from the web application. Here is my script require_once ('FileMaker.php'); $fm = new FileMaker(); $fm->setProperty('database', 'comms__web'); $fm->setProperty('hostspec', 'http://192.168.X.XXX'); $fm->setProperty('username', 'web'); $fm->setProperty('password', 'XXXXXXXXXXXXXXXX'); $newPerformScript = $fm->newPerformScriptCommand('Web','TestScript','test'); $result = $newPerformScript->execute(); Please help me out here... Been trying to research this issue and nowhere really actually helps. Cheers Jack Edited June 24, 20169 yr by Jack Wright Some mistakes
June 25, 20169 yr if (FileMaker::isError($result)) { echo "<p>Error: " . $result->getMessage() . "</p>"; exit; } 2. Insert a Show Custom Dialog step at the beginning of the FM script to show get(ScriptParameter)
June 27, 20169 yr Author On 6/25/2016 at 3:46 AM, doughemi said: if (FileMaker::isError($result)) { echo "<p>Error: " . $result->getMessage() . "</p>"; exit; } 2. Insert a Show Custom Dialog step at the beginning of the FM script to show get(ScriptParameter) WIll try this now, Thank You I should also note, that when I try to set a variable for the parameter there is no parameter there.
June 27, 20169 yr Author I tried your method... No error was thrown, but no parameter was set either... This is really odd, everything else works
June 27, 20169 yr I've used CWP for a while now, and it's very rare that I find I need to use a FileMaker script to achieve what I want to... So, I've little insight on making it work as written. But - why can't the form submit and insert to the database. The returned data also includes all the data from the layout where the input happened on the FileMaker side. Then use that data to phpMail the user with required details. HTH
June 28, 20169 yr I don't know what Show Custom Dialog will do for you. You're running the script via CWP. Show Custom Dialog isn't a supported script step. 1) Post your FileMaker script 2) How do you know the script is succeeding, just not the parameter? 3) If that's true, there may be a problem on the FM script side, not the PHP side.
June 29, 20169 yr Author On 6/28/2016 at 6:12 AM, David Jondreau said: I don't know what Show Custom Dialog will do for you. You're running the script via CWP. Show Custom Dialog isn't a supported script step. 1) Post your FileMaker script 2) How do you know the script is succeeding, just not the parameter? 3) If that's true, there may be a problem on the FM script side, not the PHP side. 1) - For this instance it is the test script: (view the image) 2) - In the test script I ask it to make a new layout then post the ID into that layout (The ID being the PHP_ID sent from the form itself) - The record is created, but no parameter, and you can see that I did an if statement to check whether there was a parameter, and when that was active no record was made, hence there wasn't a parameter, but without it a record is made so it is just the script that works. On 6/27/2016 at 11:22 PM, webko said: I've used CWP for a while now, and it's very rare that I find I need to use a FileMaker script to achieve what I want to... So, I've little insight on making it work as written. But - why can't the form submit and insert to the database. The returned data also includes all the data from the layout where the input happened on the FileMaker side. Then use that data to phpMail the user with required details. HTH For a bit of context... The user fills a form and the data is sent directly to the database (That works fine) - The idea is to notify someone of when that message is sent, so I generate a random ID (I call the PHP_ID) this is then inserted into the database with the form and used as a parameter on the script, The script will then be written to check the parameter ID to the ID in the message, then send a notification to the user accordingly... So if Someone was to fill the form out with the details Dept: testDept User: testUser Message: testMessage it would put those details (including an ID, date timestamp etc.) as well as the PHP_ID into a record on the database... The script is then called which uses the SAME PHP_ID as the parameter. That script then looks through the database to find the record with the same PHP_ID, it will then send a notification to testUser on the filemaker database.... If I cannot pass this parameter I cannot do the check, thats where the issues lies. Edited June 29, 20169 yr by Jack Wright I was refering to layouts not records - may have been confusing
July 1, 20169 yr Author Thank you all for your input. I managed to solve the issue, by simply changing the Filemaker script around...
Create an account or sign in to comment