function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rocio VivancoRocio Vivanco 

Variable does not exist: Apex.StandardController

Hi all,

I am having problems to save my controller code. It is about add contacts in a textarea, these contacts should be filtered by a given account.
Besides, It should control the functionality of a popup displaying a checkbox and the contact name.
I have added these code lines to my controller:
 
public with sharing class MyController {
  public string lookUp{get;set;}
   public list<Contact> contactList{get;set;}
   public Id accountId {get; set;}
   public boolean bool{get;set;}
   public set<id> contactids{get;set;}
   public boolean check{get;set;}
   public list<conContact> conList{get;set;}
   public ApexPages.StandardController controller;

  public MyController(ApexPages.StandardController con) {
     
      controller = con;
      conList = new list<conContact>();
      bool = false;
      contactids = new Set<Id>();
   }

public class conContact{

       public Contact con{get;set;}
       public boolean check{get;set;}

       public conContact(Contact c, boolean boo){
         con = c;
         check = boo;
       }
   }
    
    
    public void init_contact(){
       list<Contact> selectedContacts = new list<Contact>();
       lookUp = '';
       for(conContact conObj  : conList){
           if(conObj.check != false){  
              system.debug('conObj.con'+conObj,con);
              selectedContacts.add(conObj.con);
              lookUp += conObj.con.name + ' ,' ;
              system.debug('lookUp::'+lookUp);
              contactids.add(conObj.con.id);
            }
        }
        bool = true;
   }

But I get the error:

Variable does not exist: con

I have checked my code and it seems to be everything ok. Perhaps, is there something I am missing here?. What would it be?.

I would appreciate if someone could give me tips.
Best Answer chosen by Rocio Vivanco
Alain CabonAlain Cabon
Hi,

You probably solved your problem yet (replacing a comma with a period).

 system.debug('conObj.con'+conObj.con);

Regards

All Answers

Alain CabonAlain Cabon
Hi,

You probably solved your problem yet (replacing a comma with a period).

 system.debug('conObj.con'+conObj.con);

Regards
This was selected as the best answer
Rocio VivancoRocio Vivanco
AlaIn thanks you so much!!!. Yes!!!. I hadn't noticed it.