Skip 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 a script via a "refresh-redirect" page

Featured Replies

I need to run a script immediately after a record is created from a form. I am wanting to do this using a refresh-redirect page that executes the script. So far, I have found examples of script execution from forms (buttons)and links, but I haven't seen this done using a redirect page.

My best (bad) guess at the refresh code is:

<META HTTP-EQUIV="refresh" content = "1;URL=FMPro?-db=NewHOSC.fp5&-format=HOSC_Success.htm-error=HOSC_Error.htm&-NAME=-Script&-VALUE="SetCalculations"&-recid=[FMP-Currentrecid]&-Find>

Can someone please show me an example of this that will work? Also, if there is a better method of doing this, I'd appreciate hearing it.

Thanks in advance ...

You might be interested in this which I posted yesterday on the Web Companion forum:

"Addam notes in regards to IWP, "Many scripts won't work via the web."

If you will review these forums you will find a great deal of discussion about ScriptMaker and the web. In point of fact, unless you develop a work around (one developer offered a solution and allowed it to be tested at a website now no longer there) to the issue, ScriptMaker should be avoided on the web - period.

The issue is complex. First, ScriptMaker is single-threaded and does not queue multiple-event requests. Second, cdml has no way in and of itself to recognize an event failure and cannot in and of itself respond with an error page when an event fails to perform. This is true even in Pro6.

If you are running ScriptMaker, you need to test it thoroughly in a multi-user/multi-event-request environment, and you need to confirm the running (or non-running) of the script event in such an environment through an examination of the database(s) in which the script runs."

If you need to, you could do something like this:

<form action="FMPro" method="post">

<input type="hidden" name="-DB" value="mydb.fp5">

<input type="hidden" name="-Format" value="results.htm">

<input type="text" name="myfield">

.

<input type="hidden" name="-Script" value="MyScript">

<input type="submit" name="-new" value="Add Record">

</form>

This is from the "CDML Reference" database.

Good Luck.

Garry

Hey Philip,

Garry has it right. Is there some reason that you want to trigger the script from the redirect page instead of the original submit page? If I remember correctly, the script will execute after it submits the form, not before. Or is there something special that happens on the redirect page first? Let us know.

-Jeff

And why to run script at all?

  • Author

Thanks for the input, guys. Well, I guess there really isn't any reason to use a redirect page if the hidden script will execute immediately following record creation. I just wasn't sure how to do it.

Anatoli: I knew you were going to say that wink.gif. I have a form containing some questions contained in global text fields. The script sets the contents of some text fields equal to the value contained in some global text fields in order to capture the questions on a survey form (the global field text may change from time to time for the same question). There may be a better way to do this than with a script, but I don't know what it is. Any workarounds for this kind of problem? There will be a relatively small number of people using this solution at any given time.

You could have another Table/Database which contains the questions; rather than use Global Fields.

All the best.

Garry

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.