Dear all,
I have created an app that should create a unique ticket number when a end user submits a ticket.
My app is running on a SharePoint list, where I have created an column "Ticket number" I imported this field to my Edit form and set the default to sum(Last('Sharepointlist').ID+100001) when the last id is 10 it should give me a ticket number of 1000011 and this workes fine.
The issue is that when 2 or more end users want to submit a ticket on the same time they all will get this ticket number, because the default ticketfield will get filled in on the time the ticket get opened. So I created the next solution:
On the submit button where I Submit the form I have entered the following code:
Set(ticketnumber,true);
SubmitForm(Form).
On the DataCardValue from the ticket number I have created the following code:
If(
Ticketnumber = true,
sum(Last('Sharepointlist').ID+100001)
)
With this solution I thought I could avoid duplicate ticket numbers, but somehow it still isn't working, I still get duplicates.
Is there any best practice for unique ticket numbers?
Thanks!
Ramon