Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Field Calc, Retry if (error) not unique


This topic is 5164 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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...

Posted

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.

Posted

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?

Posted

Thanks guys, I will go with the script.

I know the odds are low, but for this project it too risky.

This topic is 5164 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.