Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

  • Newbies
Posted

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.

This topic is 6016 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.