2 Replies Latest reply on Oct 24, 2011 12:31 PM by mgores

    finding any duplicates upon exiting a field

    kilbot

      Title

      finding any duplicates upon exiting a field

      Post

      I have a field that once exited I would like to have a script run and let me know if the text in the field has already been used. Help

       

      thanks

        • 1. Re: finding any duplicates upon exiting a field
          philmodjunk

          Define a SelfJoin by making a new occurrence of your table and relating them by your text field:

          YourTable::TextField = YourTable 2::textField

          An OnObjectExit or OnObjectSave script can then use this relationship to check for duplicate values:

          If [Count ( YourTable 2::textField ) > 1 ], then this record is not the first record to store that value in this text field.

          This assumes that their are no return characters in your text field. If returns are permitted, a different approach would be needed here.

          • 2. Re: finding any duplicates upon exiting a field
            mgores

            You could change the validation in the field's definition to be unique, that will give you an error message if you enter a duplicate value.  You can choose to let the user override this validation if you just want a warning.