You need to sign in to do that
Don't have an account?
need to return similar leads in my class
Hello All,
i am working on a class that i want it to retrun similar leads that match the same name and another field. i am using that class to display on a page. However, i am stuck with the code a little bit. here is the code:
i am working on a class that i want it to retrun similar leads that match the same name and another field. i am using that class to display on a page. However, i am stuck with the code a little bit. here is the code:
public with sharing class MyLeadController { public static List<Lead> findLeads (Id recordId, String bank) { List<Lead> lead = [SELECT name, bank__c FROM Lead WHERE Id=:recordId]; String leadName = lead.name; List<Lead> similarLeads = getSimilarLeads(recordId, bank, leadName); return similarLeads; } return [ SELECT Id, company, bank__c, debtor__c FROM Lead WHERE Id != :recordId AND bank__c = :recordid.bank__c ]; }something worng in my class, what i need to for it return similar leads that match the same lead name and bank__c name field. then i will choose other fields from those leads to use on my page.
Your Logic is right but lead you used is a list so lead.name doesn't support in your class.Please try the below code:
Thanks
Bhargavi.