You need to sign in to do that
Don't have an account?
aswanijagadesh1.397398535585991E12
find duplicates in contact
hai
in account we have contacts ,for contacts emails are there ok fine. now i want emails of contacts of all accounts.if email is duplicated then corresponing account name will be display on visual force page (urgent )
in account we have contacts ,for contacts emails are there ok fine. now i want emails of contacts of all accounts.if email is duplicated then corresponing account name will be display on visual force page (urgent )
This can be achieved through SOQL, have you written the code for the Visualforce page? Please share if you have the code.
if not, I'd suggest you to go through the following http://www.salesforce.com/us/developer/docs/officetoolkit/Content/sforce_api_calls_soql.htm and try to build the query - if you face any issues, you can post it here.
public List<contact> dupcon{set;get;}
public List<account> acc{set;get;}
List<string> ids;
integer count=0;
public accountconemailmap1()
{
acc=[select name from account];
set<id> accountid=new set<id>();
for(account a:acc)
{
accountid.add(a.id);
}
Map<string,List<Contact>> m = new Map<string,List<Contact>>();
system.debug('44444333'+m);
List<contact> cont =[select id, lastname,email from contact where accountid in :accountid];
for(contact c :cont)
{
m.put(c.email, new list<contact>{c});
}
for(string nodup:m.KeySet())
{
dupcon=m.get(nodup);
system.debug('555555'+dupcon);
}
/*for(string nodup:m.KeySet())
{
contains =m.containsKey(nodup);
}*/
}
}
in controller i wrote like this here in map is contains emails as ids,list contacts as values .so here id are unique we have to compare email of keys with list contact email if email matches for two times then that is duplicate one.i tryed like this but not get it do any modification and find list of contacts which are having duplicate emails.