Cross Check Every Year Condition

0
Hello, I want to create an ID for joiners which should be fresh every year. Example ,if  a person joins this year and if he is the first person then he should ID like 21001 and next person should get 21002 like that.  If a person joins next year and he is the first person he should get 22001 as his ID and 22002..22002 like that. So system should check if any ID has been created in the current year. Any help, please., thanks in advance
asked
2 answers
0

Use an after create event on your user entity (let’s assume Administration.Account) to calculate the ID. Then

  • Fetch the max ID from Account
  • If the ID is from the current year, add one
  • If the ID is from last year, make a new ID for this year

 

Edit: you can get the current year using these expressions

// 2021
formatDateTime([%CurrentDateTime%],'yyyy')

// 21
formatDateTime([%CurrentDateTime%],'yy')

 

answered
0

Thank you Eric, but question is how to validate it is current year or last year.

answered