How to include Account recordtype field in Matching rule - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
swetha pagadalaswetha pagadala 

How to include Account recordtype field in Matching rule

Hi,

Account object had  3 recordtypes(recordType1 (RT1) , recordtype2 (RT2) and recordtype3 RT3)  every time when user created Account RT2, it has parent field as RT1. When  user create account RT3 , it has parent field as RT2. Here the  hirearchy is from RT1-->RT2-->RT2.  
When  the user is creating the account records with RT1 as ' ABC'' , RT2  as"ABC"  and RT3 as "ABC"--> User should be allowed to create the records here with same name.
When the user is creating the account records with same name as exisitng  then  user  should be blocked from creating the records( new record "RT1 --> ABC ") .

The above mentioned senario  has to be achieved by duplication rule. without any trigger or coding . Only configration part  shd be used. 
Any help would be appreciated  on this

 

adam marksadam marks
I would create a custom text field and then have a process insert the name of the recod type (on insert and update of record type) into that field. You can use that custom field on your Duplicate Rule logic 
Erik ChaseErik Chase
I agree with Adam, except for one thing.  You wil probably want to actually use a Before trigger, since that is the only auomation piece that runs before the duplicates run in the order of operations.  Lightning processes are one of the last things to fire in the order of operations: 
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm
Panthalarajan NagarethinamPanthalarajan Nagarethinam
This is what i did to include the Record Type in the matching rule. 
  • Create a new text field called "Account Record Type" 
  • Set the default value for that field as "$RecordType.Name" and make that field read only in the page layout. 
Use this new field in the matching creteria of the matching rule. 
Hope this will solve the problem. 
Lionel Momeni NgaleuLionel Momeni Ngaleu
Thanks Panthalarajan this is working for me too.
Thanks