2 Replies Latest reply on Jul 6, 2011 11:21 AM by fredmckinnon

    How Can I Mass Delete

    fredmckinnon

      Title

      How Can I Mass Delete

      Post

      Hey,

      We wind up each week with a large # of "empty" records - they have a timestamp and sales rep field (since these are auto-entered), but nothing else - mostly, from us hitting "Save and new" and then abandoning the new record.

      See a screenshot below - is there any way to mass delete these easily, instead of deleting them one by one.  The records aren't hurting anything, but it drives me crazy having them in there.

      I think there is a way to delete a "found set", but I don't really know how to do a find to isolate these records.

      Screenshot attached.  Currently, I'm command-E (delete) and clicking the "delete" confirmation w/ the mouse.  There has to be a better way!

      Screen_shot_2011-07-06_at_9.10.11_AM.png

        • 1. Re: How Can I Mass Delete
          LaRetta_1

          Create a script.  The pseudo-script might look something like this:

          Go To Layout [ layout based upon this table ]
          Enter Find Mode [ uncheck pause ]
          #  below, enter whatever fields are necessary to confirm that the record is truly blank.  The equal means empty field
          Set Field [ FieldA ; "=" ]
          Set Field [ FieldB ; "=" ]
          Set Field [ FieldC ; "=" ]
          Set Error Capture [ On ]
          Perform Find [ ]
          If [ not Get ( FoundCount ) ]
          Show Custom Dialog [ "no records found" ]
          Else
          Delete All Records *
          End If
          Go to Layout [ Original Layout ]

          Note that the script step 'Delete All Records' only affects records in the current found set.  This script can be manually fired each day or you can use FM Server script to run it. 

          Ideally, you would address and solve the issue of creating unwanted records because, between the time the records are created and subsequently deleted, someone could generate a summary report which, for example, derives the average price of products based upon the number of orders, or they are counting orders and their figures would be incorrect.

          You also risk the problem that someone might create a child record from one of these blank records and then you will have child orphans when you delete the parent.

          • 2. Re: How Can I Mass Delete
            fredmckinnon

            Worked perfectly - we're not doing summary reports so much right now, at least, based on # of records, so I can fire this off manually every few days just to keep things clean .... perfect!