Dear All,
i am trying to generate a unique id based upon year and month criteria. if last request id month and year is equal to current month and year then add +1 into last unique id or else generate the unique id from 001. i have written the code and it is generating ids fine. The issue is if 3 users at the same time click on the button to generate id, it generates one id but duplicates other records id. Thus, the result should be 3 unique id but i get 2 unique and one duplicate as per the 2nd unique id. How can I resolve this issue. I have the code below. Please help
Refresh('Test Request');
With({lastId :Text(Value(Right(First(Sort('Test Request',ID,Descending)).ReqId,2))+1,"000"),
lastMonth: First(Sort('Test Request',ID,Descending)).ReqId},
If(Left(lastMonth,5) = Text(Now(),"yy-mm"),
Set(lasitdvalue,lastId);
Set(lastmonthvalue,lastMonth);
Set(varReqId, Text(Now(),"yy-mm-") & lastId),
Set(lastmonthvalue,lastMonth);
Set(lasitdvalue,lastId);
Set(varReqId, Text(Now(),"yy-mm-") & "001" )
));
SubmitForm(Form1);ResetForm(Form1);
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
170 | |
94 | |
64 | |
64 | |
60 |
User | Count |
---|---|
243 | |
163 | |
95 | |
85 | |
82 |