Skip to main content
public class taskSelectClassController {

 

     

    public List<wraptask> wraptaskList {get; set;}

    public List<task> selectedtasks{get;set;}

     

    public taskSelectClassController(){

        if(wraptaskList == null) {

            wraptaskList = new List<wraptask>();

            for(task a: [select AccountId,task Name from task limit 10]) {

               

                wraptaskList.add(new wraptask(a));

            }

        }

    }

 

    public void processSelected() {

    selectedtasks = new List<task>();

 

        for(wraptask wraptaskObj : wraptaskList) {

            if(wraptaskObj.selected == true) {

                selectedtasks.add(wraptaskObj.acc);

            }

        }

    }

 

 

    

    public class wraptask {

        public task acc {get; set;}

        public Boolean selected {get; set;}

 

      

        public wraptask(task a) {

            acc = a;

            selected = false;

        }

    }

}
2 risposte
  1. 26 feb 2020, 07:21

    hii sir,

    >

    tnx for the code.

    i have another requirement i have a detail page button on the the

    account, when i click it then visualforce page will open .

    when enabled the checkbox then those records should be assigned to that

    account as child records. ( i have lookup relation in custom object with

    account )

    can you help me on this

0/9000