Pages

Wednesday, December 3, 2025

Salesforce: Campaign Member Deletion

Contact or Lead Deletion

When a Contact or Lead used in a Campaign Member is deleted, all Campaign Members for that lead or contact will also be deleted.

Undeleting the Contact or Lead from the Recycle Bin will restore all Campaign Members for the Contact or Lead, including the Status. However, the Last Modified Date and By of the Campaign Member record will be updated with the timestamp of when the Contact or Lead is undeleted, along with the name of the user who performed the undeletion. The Campaign Member ID will be restored to the original Campaign Member ID. 


Campaign Deletion

When a Campaign is deleted, all Campaign Members associated with that Campaign will also be deleted.

Undeleting the Contact from the Recycle Bin will restore all Campaign Members for the Campaign, including the Status. However, the Last Modified Date and By of the Campaign Member record will be updated with the timestamp of when the Campaign is undeleted, along with the name of the user who performed the undeletion. The Campaign Member ID will be restored to the original Campaign Member ID. 


CampaignMember Deletion

When a Campaign Member record is deleted, it is not sent to the Recycle Bin, so it cannot be restored. Vote for this idea.


Bonus: In the CampaignMember object, there are LeadId, ContactId, and LeadOrContactId fields. For a Lead in Campaign Member, when the Lead converted to a Contact:

  • The LeadOrContactId will be updated from LeadId to ContactId
  • The LeadId will not be changed
  • The ContactId will be populated with the Contact ID


Monday, December 1, 2025

Excel: Count of Duplicate

We have recently encountered duplicate data entries being created in Salesforce by automation, resulting in multiple entries with the same lookup value. 

A spreadsheet is still one of the most widely use tools shared among business users. In this blog, I'll have 2 scenarios:

1. Mark how many duplicate roles based on a key field.

I know this can be achieved easily with a pivot table, but it would be great to see the number in the table itself.

sample: Excel formula for row 2, and the unique key is in column E

=COUNTIF(E:E,E2)


2. Mark rows to be kept and to be deleted

From the duplicate row, we need to keep 1 row and delete the rest.

Excel formula for row 2 =IF(COUNTIF($E$2:E2,E2)=1, "Keep", "Delete")

Excel formula for row 3 =IF(COUNTIF($E$2:E3,E3)=1, "Keep", "Delete")



Page-level ad