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.

Running Scripts from web page

Featured Replies

  • Newbies

Trying out the new 9.0 web PHP. In 6.0, I used to put a "-script" tag and run the script after I create a new record. The script sets fields in the record after it is created. In PHP, I put this in the confirmation page:

$recid = $record->getField('current_record_ID', 0);

$findCommand =& $fm->newFindCommand('WebRegistration');

$findCommand->addFindCriterion('current_record_ID', $recid);

$findCommand->setPreSortScript('TEST2','22');

$result = $findCommand->execute();

The script runs and changes the field in the database, but what is displayed on the confirmation page is the value before the script is run.

Also, do I need to do the findcommand?

-Thanks!

After you run the find, do you refresh the PHP variables in your web page before displaying the confirmation information?

Below is a sample that works successfully for me:

$BillingActivate=new FX($serverIP,$webCompanionPort);

$BillingActivate->SetDBData($fmFile,'webngUsers', $groupSize);

$BillingActivate->SetDBPassword($webPassword,$webUser);

$BillingActivate->AddDBParam('KEY',$KEY);

$BillingActivate->AddDBParam('-script.presort','LocalActivateAcc');

$BillingActivateResult=$BillingActivate->FMfind();

foreach( $BillingActivateResult[ 'data' ] as $key => $activateData ) {

$recid = $activateData['recid'][0];

$UID = $activateData['UID'][0];

$KEY = $activateData['KEY'][0];

$Organisation = $activateData['Organisation'][0];

$nameFirst = $activateData['NameFirst'][0];

$nameLast = $activateData['NameLast'][0];

... etc etc

}

... now generate the necessary HTML including the changed variables you want to display on the confirmation page.

HTH

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.