Jump to content

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

Recommended Posts

Posted

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 ...

Posted

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."

Posted

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

Posted

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

Posted

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.

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