Reset Auto Increment Value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • blueprint
    Active Community Member
    • Jan 2019
    • 223

    Reset Auto Increment Value

    How can I reset (or alter) the current value of an auto-increment field (in the Case entity)?

    Thanks
  • blueprint
    Active Community Member
    • Jan 2019
    • 223

    #2
    Anyone?

    I've tried resetting the AUTO_INCREMENT MySQL value for the Entity table but this has made no difference.

    Comment

    • eymen-elkum
      Active Community Member
      • Nov 2014
      • 472

      #3
      if you mean the "number" field type then you need to update the next value in the "next_number" table, there you will find a record against every number field in your crm
      CEO of Eblasoft
      EspoCRM Expert since 2014
      Full Stack Web Developer since 2008
      Creator of Numerous Successful Extensions & Projects​

      Comment

      • blueprint
        Active Community Member
        • Jan 2019
        • 223

        #4
        eymen-elkum Thanks for your suggestion, however, the Case entity does not appear in this next_number table.

        Comment

        • yuri
          Member
          • Mar 2014
          • 8440

          #5
          It can be done through Entity Manager.
          If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

          Comment

          • blueprint
            Active Community Member
            • Jan 2019
            • 223

            #6
            yuri Unfortunately it does not seem to be the case. When I go into the Case entity and look at the "number" field, there is no way to change the value.

            The only options I have are: "Label", "Disable inline edit" and "Tooltip Text"

            Comment

            • eymen-elkum
              Active Community Member
              • Nov 2014
              • 472

              #7
              Hi blueprint , if you not solved this yet try this sql statement:


              ALTER TABLE `case` AUTO_INCREMENT = 1

              I thought you was talking about a "number" typed field, but when I checked it on the entity manager I found it as "autoincrement", sorry

              NOTE: I prefer to truncate the table in most cases, because reseting the autoincrement to 1 will cause conflicts errors for the new cases with an existing values

              TRUNCATE TABLE `case`;
              Last edited by eymen-elkum; 07-04-2019, 08:36 AM.
              CEO of Eblasoft
              EspoCRM Expert since 2014
              Full Stack Web Developer since 2008
              Creator of Numerous Successful Extensions & Projects​

              Comment

              Working...