1

vf page

apex code

public class duplicationAA {
    List<aggregateResult> Duplica {get;set;}
    List<Contact> contro {get;set;}
    contact c {get;set;}
    public List<aggregateResult> getDuplicamethod()
    {
        contro=new List<Contact>();
        Duplica=new List<aggregateResult>();

        Duplica=[SELECT Department,Email,LastName,Name,Phone,Title,count(id) FROM Contact 
                 GROUP BY Department,Email,LastName,Name,Phone,Title HAVING count(id)>1];

        for(aggregateResult a:Duplica){
            Contact c=new Contact(Department=(String)a.get('Department'),
                                  Email=(String)a.get('Email'),
                                  LastName=(String)a.get('LastName'),
                                  Phone=(String)a.get('Phone'),
                                  Title=(String)a.get('Title'));
            contro.add(c);
        }
        return Duplica;
    }

}

1 Answer 1

0

your variables should be public else it will not be accessible in vf page

get set property variable should be public

public List<Contact> contro  {get;set;}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.