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
soorya rsoorya r 

Cannot read property 'push' undefined in console

Hi all,
I am using a onclick javascript button in contact list view  its working as excepted in contact tab but  When i am clicking the same onclick javascript function in console tab it shows error as 'Cannot read property 'push' undefined' . I don't know ,why i am getting this this error only i am trying in console tab itself? So please anyone help me. the code is below:


    var recordIds = {!GETRECORDIDS($ObjectType.Contact)};
    var phNumbers = [];
    var jsonObject = [];
    var phNum = '';
            
            for(i = 0; i < recordIds.length; i=i+1) {
                var som = idPhoneMap[recordIds[i]];
                phNum = som.substring(0, som.length);
                phNumbers.push(phNum);
                item = {}
                item['id'] = recordIds[i];
                item['phone_number'] = phNum;
                jsonObject.push(item);
            }
  Thanks all.