+ Start a Discussion

Multiselect checkbox is not working when we have one record.

Multiselect checkbox is working wehn i have one record.
please suggest.
Below is my code. I've copied the code from below Link in my dev Org. If I have 2 or more records it is working.
If I have one record and  if i select the chcek box it is not selecting the all checboxes.
Code from below URL
ShirishaShirisha (Salesforce Developers) 
Hi Surya,


I would suggest you to capture the debug logs while trying to select the checkbox which is not working as expected to know,if there is any error like "List Has no rows for SObject" which help you to fix the issue.


Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
Hi Shirisha,

in Logs I'm getting undefined. below is the code

handleSelectAllContact: function(component, event, helper) {
        var getID = component.get("v.contactList");
        var checkvalue = component.find("selectAll").get("v.value");  
        var checkvalue1 = component.find("selectAll")
        var checkContact = component.find("checkContact");
        console.log('size-'+checkContact.size );
        console.log('-check'+checkvalue1.length );
        if(checkvalue == true){
            console.log('#####-'+checkContact.length );
            for(var i=0; i<checkContact.length; i++){
            for(var i=0; i<checkContact.length; i++){