how to get selected record

how to get the selected record when a grid button is pressed? Its kinda simple…

tasks = document.all[‘crmGrid’].InnerGrid.SelectedRecords;
if (tasks.length > 0){
  for (i=0; i < tasks.length; i++ ){
    var pId = a[i][0];
    var pType = a[i][1];
    alert(pId + ‘: ‘+pType);
  }
}

Comments are closed.