I must be blind, but I can't seem to find the function to delete all imported leads. I inadvertently told the import to do a duplicate check, but the csv has already been scrubbed - I wanted dups with the same name.
I must be blind, but I can't seem to find the function to delete all imported leads. I inadvertently told the import to do a duplicate check, but the csv has already been scrubbed - I wanted dups with the same name.
I WAS blind... I caught a cold and I'm not thinking clearly... Sorry for the bother...
Here's a simple mysql script to search for and delete leads based on a list of emails that are invalid or have bounced:
1. -- the select statement. Select is on 4 tables for the whole picture --
SELECT
ea.email_address, ea.deleted,
ab.date_created, ab.deleted,
ld.first_name, ld.last_name, ld.lead_source, ld.deleted,
sf.date_modified, sf.deleted
FROM
email_addresses ea,
email_addr_bean_rel ab,
leads ld,
sugarfeed sf
WHERE 1
AND ea.id = ab.email_address_id
AND ab.bean_id = ld.id
AND ld.id = sf.related_id
AND ld.deleted = 0
AND ea.email_address IN (<insert list of emails here>)
2. -- the UPDATE statement, System only shows current deleted=1 on 2 tables --
UPDATE
email_addresses ea,
email_addr_bean_rel ab,
leads ld
SET
ab.deleted=1, ld.deleted=1
WHERE 1
AND ea.id = ab.email_address_id
AND ab.bean_id = ld.id
AND ld.deleted = 0
AND ea.email_address IN (<insert list of emails here>)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks