rivet Posted October 1, 2010 Posted October 1, 2010 Looking for the best approach. I have a field 'password' that on record creation gets populated with a random string. The field validation set to unique. So, I would like the password filed to auto populate with a unique number. Can I create a looping calculations (on its own, or via custom function ) that will keep trying until it is unique. OR, do you think it has to been done with a script.
wireshop Posted October 1, 2010 Posted October 1, 2010 The only way to do looping calcs is through recursion - a function that calls itself. So you can make a custom function that calls itself. Good luck...
comment Posted October 1, 2010 Posted October 1, 2010 I would script this. A calculation would require a custom function AND a list of existing values - which means either a value list or a x self-join. A script, OTOH, needs only to check for validation error upon committing the record - and you only need to do this once per record anyway.
wireshop Posted October 4, 2010 Posted October 4, 2010 Actually on second thought why bother at all. Just don't require the password to be unique. After all if it is a random string the odds are very low you will have a duplicate and will it even matter if you do?
comment Posted October 4, 2010 Posted October 4, 2010 After all if it is a random string the odds are very low you will have a duplicate That depends on the length of the string and the number of records.
rivet Posted October 4, 2010 Author Posted October 4, 2010 Thanks guys, I will go with the script. I know the odds are low, but for this project it too risky.
Recommended Posts
This topic is 5520 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now