Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Is it possible to import records and update the auto-enter serial number by script?

I'm doing some development on a solution that is currently deployed. I am not doing the development 'live'. I want to work on the development copy, then import any changes to the data that have been made in the interim.

I've put together a script that runs in the 'live' file that finds all the recently modified or created records in each of the 12 tables in separate windows. Then I run a script in the 'development' file that imports from each of those tables.

I don't want to re lookup values (users may have modified those values and I don't want them to revert), or change the 'modified by' fields (confusing to users) or trigger any of the other auto-enty options...except I need the serial number to update, otherwise when the developed file goes 'live' I'll get duplicates.

Any ideas?

Posted

In each table, you need to:

1. sort asc by id

2. go to last record

3. set next serial value id, id +1

Posted

This is one of the most annoying FileMaker bug for me: the Set Next Serial Value offers a checkbox where to select the field, exactly as the Set field step does. But if you don't check it with Set Field, FileMaker interprets it as "current field". If you do the same with Set Next serial value, it just doesn't work.

With this corrected, an update script like you want to do would take less thant 10 lines and work in every situation, even with a new table.

Posted

:idunno: My method works every time. What didn't you like about it that you went in another direction? Oh well, I guess some people take advice and some have to make their own mistakes in order to learn. Yes, my feelings are hurt.

  • 2 weeks later...

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