You can do it multiple ways.
Method 1
- When creating new object for the entity, retrieve the last created item for that day in the entity, take the sequence number from the last record, increase it and assign it to your new object
- If there are no newly created items for that day, then use 000
Method 2
- You can follow a sequencing mechanism
- You can have an entity which maintains the start number, current sequence number, step increment
- When you create the entity, you take the current sequence number, use step increment to get the next number and assign it to your token
- Update your sequence entity
- With a scheduled event which runs at every day (start of the day), you can reset your sequence table
Take a look at https://docs.mendix.com/refguide/xpath-query-functions to derive your own intuitive ways that suites your needs.
If you want to compare the start of day, you can use the token '[%BeginOfCurrentDayUTC%]' or '[%BeginOfCurrentDay%]'