Jump to content

Newbie: unique field?


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

Recommended Posts

Hi everybody! I've been browsing this group for quite a while and I've always found lots of useful information. I still consider myself to be a newbie, though. Hence my question:

I have a database where one of the fields describes a filename fpr a jpg-file. This field is made up of parts of other fields in the same record (category, subcategory, date, etc.). So I use a calculation to generate this filename. The filenames can look something like "ALIBEC01REF010204.jpg" Is there a way I can check that the generated name is unique? If I choose the field type to be unique, I get lots of errors while entering the information. Can I validate the field? Any help on this matter would be greatly appreciated!

Per-Otto

Mexico City

Link to comment
Share on other sites

I Per-Otto,

If your calclulation is indexed...

Create a global text field. Create a self-join relationship that has the global text field on the left and the calculation on the right. Create a number calculation that looks like:

Count(self-join relationship::filename)

When you create a new record, insert the candidate filename into the global - if the filename already exists, your Count calculation will show a positive value and you can act accordingly.

Link to comment
Share on other sites

Thanx! It seems to work, I get instances, however, when my field dupecount, which holds the count(ctrack::value) already has a 1 as a result, even though I'm working with the first record of the database (the db is otherwise empty). Is this an error or should I do a check for the case when dupecount>1?

Thanks so much for your help!

Link to comment
Share on other sites

This topic is 6539 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
 Share

×
×
  • Create New...

Important Information

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