Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

Is there a way to set a number field to always be equal to the value of the same field from the previous record..... plus an increment of 1?

What I have in mind is something that produces a similar result to an auto-enter serial number.

What I want to be able to do is delete a record in the middle of a list and have the number value for the next record adjust itself automatically to be equal to the new "previous" record.

I hope this makes sense.

Any ideas?

Posted (edited)

Take a look at the Auto Enter Options available for the Fields.

In the Define Fields, Click on the Field to be serilized, click on Options, Auto Enter, Serial Number.

Lee

Edited by Guest
Posted (edited)

Is there a way to set a number field to always be equal to the value of the same field from the previous record..... plus an increment of 1?

What I have in mind is something that produces a similar result to an auto-enter serial number.

What I want to be able to do is delete a record in the middle of a list and have the number value for the next record adjust itself automatically to be equal to the new "previous" record.

I hope this makes sense.

Any ideas?

Why do you want to do this? I suppose there are some reasons for it, but most of the time it is unnecessary. In a relational setup, changing ID numbers (especially if you are using them as the match field in the relationship) opens you up to a host of problems both now and as you get more data in the solution.

For your ID fields, I would stick to the normal Auto-enter serial numbers that Lee mentioned. If you really need a field consecutively numbered, you can look at the Get(RecordNumber). But keep in mind that it is very dependent on the context of the found set. Changing the found set, and sort order I believe, will affect the number if gives you.

Otherwise you could look at creating a list of numbers that you update as you create and delete records, to keep track of what is used and what is not. Kind of a transactional model of sorts.

Edited by Guest
Posted

Thanks guys for your help.

FWIW:

I include a serial number field on almost every database I write.

As Lee suggested, I do this with an auto-enter, serial number option.

For this particular application I am trying to serialize tasks for building processes in my cabinet shop.

Usually the task list is developed proactively.

In this case the auto enter serial number option works fine.

Often times, however, someone will add a task on an adhoc basis. This task will either be something that we forgot or something we refined. In this case we still want the tasks to array sequentially (task 1 thru 10) but can't get there with just the serial number.

Posted

Use the Replace command to re-serialise the records after they have been changed.

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