Newbies Philip Posted August 12, 2008 Newbies Posted August 12, 2008 Hello, I'm new to the FMP php API so I'm using the PHP Site Assistant. I want to create a new record and then run a ScriptMaker script on the record that is just created. on addrecord.php is the form where the user enters the data for the new record. on browsrecord.php I want to create a new record and add the post data to the record (site assistant does this perfectly). Then I want to run a filemaker script on the newly added record. Here's the section of the browserecord.php file case "new" : { $recorddata = $cgi->get('recorddata'); print_r ($recorddata); echo ($recorddata[1]); // create the new add command $newrecordrequest = $fm->newAddCommand($layoutName); ExitOnError($newrecordrequest); // get the submitted record data $recorddata = $cgi->get('recorddata'); if (isset ($recorddata)) { // submit the data to the db $result = submitRecordData($recorddata, $newrecordrequest, $cgi, $layout->listFields()); // clear the stored record data $cgi->clear('recorddata'); ExitOnError($result); // Run scriptmaker script to create parents $scriptParents = $fm->newPerformScriptCommand('web_parents', 'web_admissions_create_parents', "RECORD ID OF NEW RECORD GOES HERE"); $scriptParentsResult = $scriptParents->execute(); break; } else The ScriptMaker script takes a number that the user enters on the first page, and then loops to create that number of related records. Thanks so much for your help.
Recommended Posts
This topic is 6310 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