Hey guys,
Is there a way to generate a random unique identifier of a max of 5 chars (maybe 6), similar to a voucher code, by using some built in DW functionality? Strings and ints or just strings or just ints it really doesn't matter
Thanks!
Hey guys,
Is there a way to generate a random unique identifier of a max of 5 chars (maybe 6), similar to a voucher code, by using some built in DW functionality? Strings and ints or just strings or just ints it really doesn't matter
Thanks!
Here is an example:
http://stackoverflow.com/questions/1344221/how-can-i-generate-random-alphanumeric-strings-in-c
If you need to make 100% sure it is unique, you would have to store the generated codes and check it has not been created before.
BR Nicolai
Hi Nicolai,
Thanks for the answer. Can't we just access the voucher code logic?
Is that accessible via the API?
We need to add a unique registration ID for every submitted form (for a contest) and we are using the Forms for Editor module.
Thanks,
Adrian
You can call eCommerce.Orders.SalesDiscounts.Vouchers.Voucher.GenerateVoucher(listid, numberOfCharacters) where list ID is the ID of the Voucher code list to add the voucher to.
Thanks a lot.
You must be logged in to post in the forum