16
Views
4
Comments
Solved
want a autogenerated unique number like this TRN2024202232393
Question

my requirement is while saving data in the data base i am giving a transactionid, its like TRN2024202232393(TRN is fixed after 2024 is YYYY,02 is MM,22 is DD, and last is 32393  autogenerated number,    before saving into database i am appending all these as string and saving.     my requirement here is a want a autogenerate number per autogenerate 5 digit sequence,  it can unique in one day, because the next day anyway date field is changing, and it only be 5 digit.

*. multiple users can use a application at a same time, so it need to  generate different per each,

2023-05-23 04-55-55
Wasimkhan Syed Abuthahir
Solution

Hi,

You can use Generatepassword(5,True) for the last 5 digit. Like 

"TRN"+Year(CurrDateTime())+Month(CurrDateTime())+Day(CurrDateTime())+GeneratePassword(5,False)

Regards,

Wasimkhan S

2021-10-17 12-36-16
Amreen Shaikh

Hi Priya,

You can use GeneratePassword() built in function.

Regards,

Amreen

2023-05-23 04-55-55
Wasimkhan Syed Abuthahir

Hi,

Its a builtin function. If you start typing generatepassword it will show you in suggestion.

2023-05-23 04-55-55
Wasimkhan Syed Abuthahir

Hi,

I hope you are calling it in client action. Try calling it in server action. Generate password is a server side action.

Adding to it, I have added a sample OML.

Regards,
Wasimkhan S

Generatepassword.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.