09-30-2010 07:52 AM
Hello! Been using SLX here for many years, and I've recently taken over all administration. Wondering if anyone has a best practice or experience mass-purging leads records based on certain criteria? I'm able to get the group I want, but I'm unsure of the best way to purge / delete them -- whether that's a SQL statement, or there's a utility that I'm not finding anywhere. Using the LAN version 7.5.2, SQL server 2005, Windows 2008R2
Thanks for any help!
Solved! Go to Solution.
09-30-2010 09:05 AM
This is a manual process Im afraid (unless someone has written a util)
(1) Delete your Leads based on your criteria within Execute SQL:
DELETE FROM LEAD WHERE .....
(2) Now you need to delete the address records for those Leads:
WHERE NOT EXISTS(SELECT LEADID FROM LEAD
WHERE LEAD.LEADID = LEAD_ADDRESS.LEADID)
(3) You will also need to run the Integrity tests for Marketing:
Purge Hist_Lead, Hist_Lead_Address etc
09-30-2010 10:00 AM
You can also mass delete Leads in list mode. Before doing this please backup your database. If you do not you will be unable to undo the delete.
Note that this process can be slow if you are deleting a bunch of data.
10-06-2010 08:19 AM
If you want to purge Leads [without] generating the HIST_LEAD* records, and also want them to sync properly (if you have remote clients), you will need to write a custom function.
Basically, you would need to grab the IDs, such as by using GetGroupIDs:
And then you would call CascadeDelete for each ID in the group:
Application.BasicFunctions.CascadeDelete "LEAD", sLeadId
This would also remove all records associated with each Lead (e.g. Activity, Attachment, CampaignTarget, History, Lead_Address, Lead_Qualification, etc.).
Deleting a Lead in list view will create the HIST_LEAD* records (i.e. HIST_LEAD, HIST_LEAD_ADDRESS, HIST_LEAD_QUAL, HIST_LEAD_RESPONSE, HIST_MKTGSVC_CLICK, HIST_MKTGSVC_OPEN, and HIST_MKTGSVC_UNDELIVER), which is why deleting a Lead in list view takes a while. However, as mentioned in an earlier post, these records can be purged in SalesLogix Integrity Checker using the purge actions available under the Marketing node.