You need to sign in to do that
Don't have an account?
vijendahr k
Compare list of record with single record in salesforce
Hello All,
i have scenairo, where i have to compare with single record with list of records and if i found duplicate record i will have to return duplicate record.
Example : List<account> listAcc= [select id, name, type,startdate, enddate, designation, ( select id , name , email, from contact), (select name, id, stage from oppty) from account]
Account acc= [select id, name, type,startdate, enddate, designation, ( select id , name , email, from contact), (select name, id, stage from oppty) from account where id='XXXXXXXX'];
now i have to compare account (acc) record with all the list of records from listAcc data with parent and child records. if i found same record in then i have to return duplicate record found.
Thanks
i have scenairo, where i have to compare with single record with list of records and if i found duplicate record i will have to return duplicate record.
Example : List<account> listAcc= [select id, name, type,startdate, enddate, designation, ( select id , name , email, from contact), (select name, id, stage from oppty) from account]
Account acc= [select id, name, type,startdate, enddate, designation, ( select id , name , email, from contact), (select name, id, stage from oppty) from account where id='XXXXXXXX'];
now i have to compare account (acc) record with all the list of records from listAcc data with parent and child records. if i found same record in then i have to return duplicate record found.
Thanks
If you want to compare list of records with single record, you can put the records in set and use method of set/ for e.g
set<Account> setAcc= //some set
Account acc;//some account
if(setAcc.Contains(acc)){
return acc;
}
Let me know if this helps