Hi how i can generate a sequence number for example for my supplier i want supplier_id to start with C0xxx example first C0001, C0002, C0003, etc and save that to database when i create the supplier.
any tips appreciate it
thank you
Hi how i can generate a sequence number for example for my supplier i want supplier_id to start with C0xxx example first C0001, C0002, C0003, etc and save that to database when i create the supplier.
any tips appreciate it
thank you
You can do this in the database natively. What type of database are you using?
mysql for now but its possible to add sequence but with a format like C00XXX for example?
I think you will need a combination of a query to check the last or most recent value for the supplier_id and then transform that to add +1 though this seems like it could be more work then you would prefer - you may have to store/concatenate the prefix to the incremented value and then store the complete string in another column
So, in one column you have C and in another column you have an auto incremented supplier_id 00001
you would then simply concatenate C and 00001 for each row when you query to get information and add that to another column supplier_sku C000001 or name it as something else
That works thank you