Jump to content

Automatic Perform Script on New Record?


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

Recommended Posts

Note: The answer to this may be the same as that given to "spm" earlier today (see "Initiating Scripts") but I'm hoping there's something easier/cheaper.

----

I have created a script w/in Filemaker 4.0 which finds the data in a field ("thisgroup") on the previous record, copies it, and pastes it in a different field ("lastgroup") on the new record. This different field ("lastgroup") performs a calculation and enters the result in the original field ("thisgroup") on the *new* record. Then the next record to come along repeats the process. (All this is to accomplish a rotating designation of either 1, 2, 3, or 4 to each new record.It was the simplest means I could devise, though there may be a slick shortcut to get me beyond the problem noted below.)

The script works fine, either from the Script menubar or from a button I created to run it. The problem is it doesn't do it automatically upon the creation of a new record, and this is something I need, as the new records will be created using CDML tags on the web, and I need the reply page to contain some of the field data generated by the script. I've tried including a script tag in my CDML, but it doesn't work. I don't care if the automatic start is controlled by the HTML/CDML interaction, or within FileMaker, but I'm stumped as to how to make it happen.

Any ideas?

The script is pasted below, followed by the script tag I've used in my HTML page. Maybe someone can tell me where I've missed the boat.

Script: Perform Script ["lastlookup"] Enter Browse Mode [] Go to Layout ["master"] Page Setup [Restore, No dialog] Go to

Record/Request/Page [Previous] Copy [select, "thisgroup"] Go to Record/Request/Page [Next] Paste [select, "lastgroup"] Exit Script

Tag (inside Form /Form tags) on HTML page <INPUT TYPE="hidden" NAME="-Script" VALUE="lastlookup">

Link to comment
Share on other sites

Peter, your form action code "<INPUT TYPE="hidden" NAME="-Script" VALUE="lastlookup">" looks ok.

Where I'm getting confused is your script "lastlookup". You say you have pasted the script and it begins"Script: Perform Script ["lastlookup"] Enter Browse Mode []..."

Are you sure the -script value="lastlookup" starts "Perform Script ['lastlookup']"? Seems that the Perform Script step is a redundancy. But I could be wrong.

Peace

Keith M. Davie

Link to comment
Share on other sites

This topic is 7661 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
 Share

×
×
  • Create New...

Important Information

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