Deduplication on Company Phone and Email Details

By | June 15, 2017

Sage CRM gives us the provision to validate the duplicate company records with the help of Deduplication applied on Company Name or other company details, however there is no such standard method to validate Phone or Email details existing in the system. In this blog, I will share a method through which you can apply Deduplication on Phone or Email details.

New Stuff: Delete Quote Line Items using JavaScript

We applied a Table Level Script on Company Entity which triggered a prompt whenever a User tried to save phone or Email details which matched with some other Company account of CRM.

Following are the steps to perform the validation:
1. From the customization open the Company Entity and Click on the Table Script
2. Select the Script type as Table Level.
3. Add the following code in the InsertRecord() function and save the TLS.
var cPhone=””;
var cEmail=””;
var CNameE=””;
var CNameP=””;
cEmail=new String(FormValues(“emai_emailaddressbusiness”));
if(cEmail==”null” || cEmail==”undefined” ||cEmail==””)
cEmail=new String(Values(“emai_emailaddressbusiness”))
if(cEmail==”null” || cEmail==”undefined” ||cEmail==””)cEmail=””;
cPhone=new String(FormValues(“phon_numberbusiness”));
if(cPhone==”null” || cPhone==”undefined” ||cPhone==””)
cPhone=new String(Values(“phon_numberbusiness”))
if(cPhone==”null” || cPhone==”undefined” ||cPhone==””)cPhone=””;
//for Email Id
var Email=”select comp_name from vcompanyEmail(nolock) left outer join Company(nolock) on ELink_RecordID=Comp_CompanyId where Emai_EmailAddress='”+cEmail+”‘”;
selectquery = eWare.CreateQueryObj(Email);
CNameE=new String(selectquery(“comp_name”));
if(CNameE==”null” || CNameE==”undefined” ||CNameE==””)CNameE=””;
var Message=””;
Message+=”This Email Id is already existing in the company [“+CNameE+”]<br>”;
//for Phone Number
var Phone=”select comp_name from vCompanyPhone(nolock) left outer join Company(nolock) on PLink_RecordID=Comp_CompanyId where phon_Number='”+cPhone+”‘”;
selectPhonequery = eWare.CreateQueryObj(Phone);
CNameP=new String(selectPhonequery(“comp_name”));
if(CNameP==”null” || CNameP==”undefined” ||CNameP==””)CNameP=””;
var Message1=””;
Message1+=”This Primay PhoneNumber is already existing in the company [“+CNameP+”]<br>”;
Now while creating a new company insert the existing email address or phone number you will get a prompt displaying following error along with the Existing Company name on the screen.

About Us:

Greytrix is one stop solution provider for Sage ERP and Sage CRM needs. We provide complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third party add-on development and implementation expertise.

Greytrix has some unique integration solutions for Sage CRM with Sage ERP’s (Sage X3Sage 100Sage 500 and Sage 300).We also offer best-in-class Sage ERP and Sage CRM customization and development services to Business Partners, End Users and Sage PSG worldwide. Greytrix helps in migrating to Sage CRM from ACTGoldmine and other CRM’s.

For more information on our integration solutions, please contact us at We will be glad to assist you.

Also Read:
1. Validate Email Addresses using Sage CRM Client Side API
2. Pop Up Email Screen before sending mail through workflow
3. Remove unwanted Phone-Email fields
4. Add an Auto Signature in Email body in Sage CRM
5. Sending Emails to multiple Persons