Jump to content

Max value from number field by this year


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

Recommended Posts

There are many ways to do that. It would be best if you explained the context in which this is needed.

each year number value begins from "1" and next number value must be next with increment = 1, but I can't do this with calculation like 'serial number' because if you delete any record, this number value will be lost.

I think the best way, is to find max number value, and set field "value+1", but I don't know how to make this script.

by clicking a button i need to see in a new record right value.

Link to comment
Share on other sites

What exactly should happen if a record is deleted?

This is difficult to implement reliably. What is this number being used for?

It's used for numbering documents.

So if I need for any record make this document, I need set max value by this year in the related table. So if any record will be deleted in related table (but I think it will be not happened) so next value must be next.

Link to comment
Share on other sites

What is this number being used for?

It's used for numbering documents.

LOL. And numbering documents is used for...?

So if any record will be deleted in related table (but I think it will be not happened) so next value must be next.

That could mean anything. You didn't mention a related table before. Technically, it's easy to count the number of records in the current year, using a relationship matching on year. The problem is that the number doesn't change until a new record is created and committed - so it's quite possible to generate duplicates.

Link to comment
Share on other sites

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