Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

  • Newbies

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.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.