Auto Generated Unique number

0
Hi, while adding a product , For every product in my app I want to give auto generated serial number in the format – SL1_UP_31032021_01 this number should be incremented automatically by one every time I add a new product. Can anyone help me on this?     
asked
2 answers
1

You could store the last generated number in an entity. When you build the next serial number retrieve this, increment it, store it, and then use it in the serial number.

You will probably want to protect this entity by providing this functionality via a dedicated microflow that has concurrency disallowed.

answered
1

You could create an entity with 1 Attribute: Autonumber.

Every time you need to generate a new unique code you can create 1 of that object( no need to commit the object).

The value of that Autonumber attribute can then be used to create your unique code: 

MyUniqueValue = ‘SL1_UP_31032021_’ + toString($TheAutonumberAttribute)

answered