function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Steve McKitrickSteve McKitrick 

Prevent Deceased contacts from being pulled into reports (Prevent accidental contact)

In our organization, we have older contacts who pass away.  We want to retain their historical records, but want to avoid accidentally contacting contacts who've passed away.  I've read that a workflow rule can be created to append or prepend their name field but I lack the ability to write the code required to make this happen.

I have inserted a custom field with a checkbox that indicates that the contact is inactive, but what would the next steps in the workflow rule look like?  Thanks in advance for your assistance.
Sanjay Mulagada 11Sanjay Mulagada 11
Hi Steve,
First off what is the criteria to know if a contact is Deceased or not ?
Step 1: Use that criteria in your workflow to do a field update, to update the checkbox field you created to "True"
Step 2: Using data loader export all the contacts from your ORG and fields to include is ContactID.
Step 3: Now do a import back with the excel(.csv) file on the contacts maping the ID fields.
      By doing the update we are triggering the workflow to fire to update the old records to check the checkbox.
 
Steve McKitrickSteve McKitrick
If we get a report that the contact is deceased and we feel that contacting them is not in their best interest, I'd put a checkmark in the INACTIVE field on the contact page layout.  I want to ensure that we dont accidentally scoop them up in a records search and contact them as part of a campaign etc.  I want to keep their record (Past History, donations, etc) but want to shield them from being searched.  I just know we will forget to filter out "Inactive" and they will get contacted.  Does that make sense?
Sanjay Mulagada 11Sanjay Mulagada 11
I dont think we can shield them from being searchable, but I think it would be better you can add INACTIVE field as one of the columns in the search window(lookup window). So in that way when you search(lookup window) you can see the column saying the contact is Inctive and checked. To add a coulmn you can edit the Search Layout section for all the objects to include Inactive checkbox field. Correct me if I answered irrelevant to your question. Thank you.
Aaron UttleyAaron Uttley

Hi Steve, 

I recently wrote a similar workflow rule to enforce naming conventions. This rule checks to see if the Name meets the naming convention outlined in the rest of the rule. If it does not, it changes it to meet the convention. In your case, you will want to create a custom checkbox to indicate if the contact is deceased and base the rule on that field.  You will need to edit this rule to include the fields used in your org.  Note that the & symbol is used to add additional text to the name, ie to append " DECEASED" to the contact's name.

The field update portion of the rule will contain the same formula, but without the NOT check.

NOT (Name = (CONTACT NAME FIELD & 
IF( DECEASED FIELD = TRUE," DECEASED " 
)))

 

Steve McKitrickSteve McKitrick
Thanks Aaron, I have labored over this code, tried several iterations

(Name = ( FirstName  & 
IF(  Deceased__c  = TRUE," DECEASED " 
)))

I keep getting this error:  ​Error: Field Name does not exist. Check spelling.
Aaron UttleyAaron Uttley
Can you confirm that your workflow rule is on the Contact object? As a note, you will likely want to ues Name instead of FirstName as well, otherwise you will end up with names like Aaron DECEASED Uttley. 
Aaron UttleyAaron Uttley
I should also point out that I used this workflow rule on Opportunity and Account objects, not Contacts, so I may be missing something with regards to the specifics (I am fairly new to the platform myself). The logic structure should be sound, however.
Aaron UttleyAaron Uttley

So I played around with this a little bit, and it appears the Name standard field is not available within workflow rules. You will have to add DECEASED to either the first name or last name, and have it set to update when that field change. So your trigger will be (assuming you want to add it behind the last name:

NOT (LastName = (LastName & 
IF( Deceased__c = TRUE, " DECEASED"
)))

The field update will be on LastName, and be:

LastName & 
IF( Deceased__c = TRUE, " DECEASED"
)


Hopefully this one works for you! 

Steve McKitrickSteve McKitrick
Aaron, Thank you for the help. I did get an error.  It seems the IF statement looks for 3 possiblities?  I added an extra "" after the Deceased in the above code and it works once the deceased checkbox is activated by a checkmark.
Thank you again!!
venkat-Dvenkat-D
Hi Steve,
Why dont use the checkbox itself to filter the records? or you can reassign ownership of all these accounts to user in higher heirarchy so that they wont show up anywhere in the system for users. That way even list views, reports, search etc will also be cleaner.
Dawna KnappDawna Knapp
Hello, Can anyone provide an update on preventing Deceased records from appearing in Reports? Our team has created automation to prevent contact (mail, email, phone) to a Deceased record, but is stuck on how to prevent Deceased records from appearing in Reports, except in snapshots of the past. Does the process to reassign ownership to a higher hierarchy work? Thanks in advance.