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
Daniel BradyDaniel Brady 

APEX trigger to update a custom text field with data from an existing Birthdate field (to get around Duplicate Match filter limitations)

I know nothing about triggers but I've determined that the only way to leverage Match Rules for Birthdate is to create a Before Insert trigger that replicates the Birthdate value as a text value into a custom text field. This would in turn allow me to use this field as a filter.

Can anyone help me out with the APEX trigger?
Best Answer chosen by Daniel Brady
vishal-negandhivishal-negandhi

Hi Daniel, 

We manage this with a process builder and it works well for us. 

What we do?

- We have a process builder that runs on Contact object and it copies birthdate into a text field using this formula 
 

TEXT(DAY([Contact].Birthdate) ) + '-' +  TEXT(MONTH([Contact].Birthdate) ) + '-' + TEXT(YEAR([Contact].Birthdate) )

Of course you can choose another format if you need. 

- Next, we have a matching rule that does a Exact match on this field. Activated. 
- Lastly, this is mapped to an active duplicate rule.

Hope this helps.