Archived and Searches

I wish to archive (not delete) some records in table. I plan to do so by including a field to identify an item as being archived.


  1. How do I prevent the archived records from showing up in the normal search?
  2. And yet give it its own search in case someone wants to search the archive?

You may use the FieldVisibility extension so that the field is available for specific users only.

If you want display of archived records to be optional then:1) make the archive flag a tinyint with a default value of 0 (which you will set to 1 for archived records)
2) in PHPM, define the field as a checkbox, and include it as an Ext. Search item on the list page
3) in the Recordset_Selecting event, put this to include archived records in the list of active records:$filter = "Archived <= " . Post(“x_Archived”, 0);…or this to show only archived records:$filter = "Archived = " . Post(“x_Archived”, 0);The idea is that if the search checkbox is left blank then you get the active records only, but if it’s checked then you add in or show only archived records.