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
aam1raam1r 

Global Action for Find Duplicates on Leads

Hi Everyone,

Requirement: Capture Find Duplicates button click event on Lead records

Current Solution: I currently have a Javascript button that checks a box on a Lead record when it is clicked and directs the page to the leadmergewizard.jsp page.  Here is the Javascript begind the button currently:
 
{!REQUIRESCRIPT("/soap/ajax/33.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/33.0/apex.js")}

var ld = new sforce.SObject("Lead");
ld.Id = '{!Lead.Id}';
ld.Duplicate_Searched__c = 1;

var result = sforce.connection.update([ld]);
if(result[0].getBoolean("success"))
{
window.location = "/lead/leadmergewizard.jsp?retURL=%2F{!Lead.Id}&id={!Lead.Id}&00Ne0000001OKhg=1";
}
else{
alert('Error : '+result);
}

New Solution needed: The above setup works fine, however i want to implement something that does this via Global Action so i can have this functionality on mobile and also Lightneing Experience.

Is this possible, and can someone guide me with any sample code if i need to implement this using triggers, classes and/or vf pages?

Many thanks for your help.
aamir