Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
New Member
Posts: 15
Registered: ‎09-03-2010
Accepted Solution

Purging Leads

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!

Bronze Elite Contributor
Posts: 514
Registered: ‎03-24-2009

Re: Purging Leads

Hi,

 

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:

 

DELETE
FROM LEAD_ADDRESS
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

 

 

 

Regards, Adam Travers
empath-e Services Limited
Bronze Super Contributor
Posts: 349
Registered: ‎03-24-2009

Re: Purging Leads

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.

 

 

  1. Create the group of Leads you wish to delete.  
  2. Get into List Mode.  
  3. Select the first record in the list.  
  4. Click SHIFT-CTRL-END to highlight all of the records in the list.  
  5. RMB | Delete Selected Leads.

 

 

Note that this process can be slow if you are deleting a bunch of data.

 

 

Timmus Agersea
Black Moth CRM
New Member
Posts: 15
Registered: ‎09-03-2010

Re: Purging Leads

Thank you so much for the advice - and so quickly! 

Employee
Posts: 629
Registered: ‎04-24-2009

Re: Purging Leads

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:

Application.BasicFunctions.GetGroupIDs(sFamilyName, sGroupName);

 

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.

 

Thanks

 

Mike