I have just created a int fields in account module, put it has auto_increment in accounts_cstm in phpmyadmin and now it work.
I have also tried to put for exemple â53â in that fields to test if it work when I will import my old database, to see if it âcontinueâ or reset everything and it seems to work, it start at 54.
Just wanted to be sure this methode is a good one, cause it seem that there is a lot of possible methode.
You can use a workflow with calculated field like, for a Quote number field:
Q-{now(Y)}-{now(m)}-{GlobalCounter(quote_number;4)}
This would populate a Quote number field with Q-2019-11-0012
You can initialize the counter with the following in config_override.php
We need to lock the table because any other instance of the CODE should not insert the next MAX record same time as multiple CRM users will be accessing it same time.
Can you please elaborate a little?
What is GlobalCounter?
What is quote_number? (field in quote module?)
Wouldnât it make more sense to use GlobalCounterPerModule instead?
We are using GlobalCounter and never tried GlobalCounterPerModule.
It wouldnât change much and I donât know exactly how you can change that in $sugar_config if you want to define an initial value .
quote_number is the name of the counter (you can chose what you want but this has to be the same in the workflow and in the initialization of $sugar_config[âSweeterCalcâ][âGlobalCounterâ].
The field in the Quote module is the one you select in the workflow.