Jump to content

How do you auto-run a script on Record/Create?


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

Recommended Posts

I know I can make a button and attach the script that way, but if the user selects the pulldown menu in filemaker and chooses to add a new record, the script wont execute. Every time I have a new record made, I need to run a script that will cycle thru EVERY record and increment an Order Field I have. I need the script to first sort the "Assignments ID" then fill up the "Set Order" fields in every record from start to end in increments of 1.

The only way I can see how to do this correctly is run a script that does that. I tried using a auto entry serial number field, but the problem there is if the user deletes a record, then there will be a gap in the order count, like 1..2..3..5..6..7....

Thanx for any help

Link to comment
Share on other sites

The only way to do this, other than purchasing a script activation plug-in, is to password protect the file eliminating the ability to add new records from the menu and forcing the user to use the button to create new records, which would also run your script.

Link to comment
Share on other sites

Two issues.

First, I agree with danjacoby. You should rethink how you are setting up the order numbers. A better solution might be to set a global field equal to the total of the orders when the record is created.

Second, using a script to create a new record with a password prohibiting the user from using the New Record command, forcing the use of a new record script, is certainly a valid way to run a script at record cretaion if other factors make it feasable to lock out the use of the menu. If you don't want to limit the user to that extent, Script Scheduler, a plugin from Waves in Motion, will allow you create a script that executes when a condition, such as a new record is created, is met.

Link to comment
Share on other sites

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