4 Replies Latest reply on Feb 28, 2014 8:02 AM by kentanderson

    Eliminating blank records

    kentanderson

      Title

      Eliminating blank records

      Post

           How do you keep from getting blank records, when the user goes to a form that is set up to open with new entry, and the user exits back to a different form, because they decided not to enter data after all.

        • 1. Re: Eliminating blank records
          philmodjunk
               

                    when the user goes to a form that is set up to open with new entry

               Why does that create a new record? That won't happen automatically. The user or a script has to explicitly create the new record.

               You can limit the users options so that "exiting back to a different from" cannot be done without running a script. The script can check the data in the current record and take appropriate action if the record is empty.

          • 2. Re: Eliminating blank records
            kentanderson

            "The script can check the data in the current record and take appropriate action if the record is empty."

            This is what I'm looking for.  How do i create a script if a field is empty and the user exits layout delete record???

            • 3. Re: Eliminating blank records
              philmodjunk

                   If [ Isempty ( YourTable::YourField ) ]
                       Delete Record [no dialog]
                   End IF

                   If you need to test multiple fields and only do this if all are empty:

                   If [ Isempty ( YourTable::YourField ) and  IsEmpty ( YourTable::YourField2 ) And IsEmpty ( YourTable::YourFIeld3 ) ...]
                       Delete Record [no dialog]
                   End IF

                   Another option is to set up a layout with only global fields for entering data for the new record. When the user clicks a Save button, the script can create a new record in your table and use a series of set field steps to copy the data from the global fields into corresponding fields in the new record. If the user doesn't click save, no new record is created and thus no record need be deleted.

              • 4. Re: Eliminating blank records
                kentanderson

                     Thank You