Normally when data is deleted from a database, it is simple enough to have a programmer write a DELETE statement in SQL to wipe out a bunch of records from a table. This technically works okay, but has some issues that one should be aware of.
SalesLogix maintains the schema of the database in its own system tables and uses this data to keep track of data structure and relationships. When data is removed using a straight database call, any child records to the records being deleted still remain in the database leading to orphaned data.
Even though this orphaned data may not be visible anywhere, from a data quality standpoint, this is not a good idea and eventually leads to useless records piling up in the database. Luckily, SalesLogix provides a purge data wizard that allows for purging a set of data and their child records - based on conditions that you might want to specify.
To purge data, launch the Tools --> Maintenance --> Purge Data Wizard
It will walk you through a series of steps that help you specify the exact data set that needs to be purged.
Depending on which record you are on, the wizard will automatically check the box that matches that record type. For example, if you launch the wizard from Contacts, the default Contacts button is checked as in the screenshot below:
The wizard will allow you to select one of the following methods of selecting the dataset for deletion:
- Based on the value in a single field
- Allows for selection of a field, an operator and a value that will be used as a condition for the deletion.
- Based on the values in two fields
- Same as above, but allows for 2 conditions to be created.
- Entire current lookup or group
- If a group can be created using multiple conditions and joins, then this group can be used as the basis for the record deletion.
- Active record
- Only the record that is currently being worked on will be deleted
- Currently selected records
- This allows you to highlight a set of records in the group view and only have those highlighted records be deleted.
From experience, I have found it best to delete based on a group. This is because:
- The data in the group can easily be exported to Excel before deletion. This helps in case the list has to be passed around for review.
- The group can be shared with SalesLogix users so everyone can review it before it is deleted.
- The group lets you make sure you have the conditions right before you attempt a Delete.
- In most cases there are multiple conditions to be specified and the "group builder" comes in handy to build a more complex group based on a set of business rules.Considerations for Purging/Deleting Entity Data in SalesLogix