Posts

Showing posts from August, 2019

Find duplicate records

This post will help you find the duplicate record Id in apex before creating a record in salesforce. Standard salesforce feature will always warn you about the duplicate record error, when you try to create a contact, lead and account using the standard way. What if you want to check for the duplicate record from a custom lightning form or through integration. CheckDuplicateRecord method in  CreateLeadController  class will return the duplicate record ids. After getting the duplicate record ID you can take appropriate steps to further use of this duplicate id based on your requirement. Go through the below steps to implement the scenario. Step 1 : Activate duplicate rule on Lead. Step 2 : Create a lightning form to create lead in salesforce and create a controller to check for duplicate record. LeadFormComponent.cmp <aura:component controller="CreateLeadController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexi