no autoincrement field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • peterberlin
    Active Community Member
    • Mar 2015
    • 1004

    no autoincrement field

    hello,
    I want to increment the content (a four-digit number) in a text field with each new record.
    7040,7041,7042,7043,........
    This requires knowing the value of the last record.
    Does anyone have an idea?​
    peter
  • rabii
    Active Community Member
    • Jun 2016
    • 1250

    #2
    Why not use Number (auto-increment) field. i think it should do the job for you. ​
    Rabii
    Web Dev

    Comment

    • peterberlin
      Active Community Member
      • Mar 2015
      • 1004

      #3
      There are two reasons against an auto increment field:

      A) There is already an auto increment field in the entity.
      B) An auto increment field always starts at 1 and counts through all the previous records. We already have 3300 records and want to start with the number 7041 from 3301.​

      Comment

      • esforim
        Active Community Member
        • Jan 2020
        • 2204

        #4
        You can start the number you want peter, just put 7041, and the next time you create a record I think it either use 7041 or 7042, I can't remember.

        It doesn't force you from 0. And it only start on new record

        Comment

        • peterberlin
          Active Community Member
          • Mar 2015
          • 1004

          #5
          Thank you.
          but I have found another solution. I worked with dBase in the 80s and had similar problems.
          In espo, I created a separate entity with only one record. I know exactly the ID of this data record. Now I access the fields like external storage locations. Programmers will only smile tiredly at this idea. But I have solved my problem well.

          Comment

          • shalmaxb
            Senior Member
            • Mar 2015
            • 1606

            #6
            As I have a similar problem I would like to know a bit more detailed, what exactly you did. Would you be so kind to explain a bit more? Thank you.

            Comment

            • peterberlin
              Active Community Member
              • Mar 2015
              • 1004

              #7
              This is a simple solution.
              i have created an entity named "configuration". there is only one record. The individual fields are configuration parameters for me. Since I know the ID of this record, I can easily access it.
              There is one small advantage to this. I can grant user access to these fields/parameters.​

              Comment

              Working...