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
Ramana123Ramana123 

Unexpected token 'public'. line 45. any one help me in this ?

public class taskSelectClassController {
     public  Account acct{get; set;}
       public string currentRecordId {get;set;}
       public  List<Id> tasksIds{set;get;} 
       public List<task__c> updatedRecords {get;set;}

        public taskSelectClassController(ApexPages.StandardController stdController) {
           currentRecordId  = ApexPages.CurrentPage().getparameters().get('id');
                tasksIds =new List<Id>();
        
            wraptaskList = new List<wraptask>();
            //-- if task is custom object then, you need to change this query
            //for(task a: [select AccountId,task Name from task limit 10]) 
     
           for(Task__c  a: [select Lookup_Account__c,Name from Task__c Where Lookup_Account__c = null limit 10])  {               
                wraptaskList.add(new wraptask(a));
            }
        }
    
    public List<wraptask> wraptaskList {get; set;}
    public List<task__c> selectedtasks{get;set;}
  
    public void processSelected() {
    selectedtasks = new List<task__c>();
      
        for(wraptask wraptaskObj : wraptaskList) {
            if(wraptaskObj.selected == true) { 
                
                selectedtasks.add(wraptaskObj.acc);
            }
            for(task__c var : selectedtasks)
            {
                tasksIds.add(var.Id);
            }
            List<task__c>taskRecords = [SELECT Lookup_Account__c from task__c where ID IN: tasksIds];
                updatedRecords = new List<task__c>();
            for( task__c chl : taskRecords ) {
            chl.Lookup_Account__c = currentRecordId;
            updatedRecords.add(chl);
               
        }
             update updatedRecords; 
    }
 
    public class wraptask
                          {
        public task__c acc {get; set;}
        public Boolean selected {get; set;}      
        public wraptask(task__c a) {
            acc = a;
            selected = false;
        }
    }
}
MantoManto
put a '}' on line 44 (before public class wraptask) to end your processSelected() method
Ramana123Ramana123
Thanks a lot.