There is a possibility that two users may run this MF at the same time. Disallowing concurrent execution fixes this problem, but it will block one of your users, which I guess is an undesired behavior.
Alternatively, you could use a non-persistent entity (with duplicated attributes) to fill in the form and create a persistent object with an autonumber after committing the object. This prevents the autonumber from increasing when canceled.
In that case, it is agreed that AutoNumber is not an option.
Another solution (if there is no need to display the MonthSerialNumber to the user immediately after creating the report) is to set the MonthSerialNumber afterwards in a scheduled event. (Retrieve all reports sorted by CreatedDate and set MonthSerialNumber)
Hi,
you will need to implement some locking mechanism for the number generation part - e,g, something like in this module https://marketplace.mendix.com/link/component/109405
regards, Fabian