3 Replies Latest reply on Aug 29, 2011 7:53 PM by DonWalker

    Changing auto-enter characteristics in a script

    DonWalker

      Title

      Changing auto-enter characteristics in a script

      Post

      I have a database with a unique, auto-enter registration number. In order to prepare for a new year I have copied the current registration number into a field for "last years reg #".

      I want to then blank out the current year reg # but if I set the field to "blank" nothing happens to the field. If I set the field to "zero" I violate the unique rule for the field.

      Can I change the field "unique" characteristic to "non-unique" in a script, blank the field, and then set the field back to "unique."

      Or is there an easier way to clear out the registration field for the new year?

       

      thanks,

      Don

        • 1. Re: Changing auto-enter characteristics in a script
          Abhaya

          Hi

          Unique value tells tjat all values in recors have idfferent means no duplucate value.

          So just make a script and run the step like setfield/replace field

          make sure the value already does not exist  in that field.

          Also 0/NULL is also  the part of unique key.

           

          means

          if 5 is there u can't add another 5 in that field

          so keep going in this way.

           

          Thanks

          • 2. Re: Changing auto-enter characteristics in a script
            LaRetta_1

            "Or is there an easier way to clear out the registration field for the new year?"

            Hi Don,

            I suggest you don't clear last year - you would lose your records of the prior year's registration.  Instead, why not just continue adding Registration records but include a year or date field so you know one year from the other.  If you blank/change/remove the table's unique serial ID then you defeat the purpose of it; and it cannot be used to relate to Contacts or any other table.

            • 3. Re: Changing auto-enter characteristics in a script
              DonWalker

              The registration field needs to be cleared because it is assigned by the order in which patrons arrive. I maintain last years registration number to know who participated last year by copying the current number into a another field (last years registration number). No other field is cleared so I don't lose any information, just the order in which they came in the door.

              thanks,

              Don