Jump to content
Server Maintenance This Week. ×

Prevent duplicate entry in repeating field


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

Recommended Posts

Assume this situation: A repeating text field with 10 cells. A unique alpa-numeric is placed (barcode scan) into each cell. What I want to is to prevent the dulpication of an entry that currently exists in this field. In other words I don't want the same barcode data to be used twice within the 10 cells. Can't quite fiqure out how to do this via field validation and scripting would inpracticle for the specific user.

Any suggestions?

Link to comment
Share on other sites

Maybe something like this. Make a second field that's a concatonation of the repetitons:

concat =

GetRepetition(repeat,1) & ", " & GetRepetition(repeat,2) & ", " & GetRepetition(repeat,3) & ", " & GetRepetition(repeat,4) & ", " & GetRepetition(repeat,5) & ", " & GetRepetition(repeat,6) & ", " & GetRepetition(repeat,7) & ", " & GetRepetition(repeat,8) & ", " & GetRepetition(repeat,9) & ", " & GetRepetition(repeat,10)

Then, for the field definition:

PatternCount(concat, GetRepetition(repeat,1)) < 2 and

PatternCount(concat, GetRepetition(repeat,2)) < 2 and

PatternCount(concat, GetRepetition(repeat,3)) < 2 and

PatternCount(concat, GetRepetition(repeat,4)) < 2 and

PatternCount(concat, GetRepetition(repeat,5)) < 2 and

PatternCount(concat, GetRepetition(repeat,6)) < 2 and

PatternCount(concat, GetRepetition(repeat,7)) < 2 and

PatternCount(concat, GetRepetition(repeat,8)) < 2 and

PatternCount(concat, GetRepetition(repeat,9)) < 2 and

PatternCount(concat, GetRepetition(repeat,10)) < 2

Of course, if you allow overriding it, then any time any repetition changes, it will cause the warning to appear again. So you'll probably have to make it strict.

Jeff

Link to comment
Share on other sites

This topic is 7369 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.