diff --git a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js
@@ -335,7 +335,7 @@
   },
 
   dataArrived: function (startRow, endRow) {
-    var record, i, allRows, selectedLen = this.selectedIds.length,
+    var record, i, rows, selectedLen = this.selectedIds.length,
         len, savedRecord, index, j, fields;
     fields = this.getFields();
     for (i = 0; i < selectedLen; i++) {
@@ -364,11 +364,11 @@
 
     if (selectedLen === 0) {
       // push all *selected* rows into selectedIds cache
-      allRows = this.data.allRows || [];
-      len = allRows.length;
+    	rows = this.data.allRows || this.data.localData || [];
+      len = rows.length;
       for (i = 0; i < len; i++) {
-        if (allRows[i][this.selectionProperty]) {
-          this.selectedIds.push(allRows[i][OB.Constants.ID]);
+        if (rows[i] && rows[i][this.selectionProperty]) {
+          this.selectedIds.push(rows[i][OB.Constants.ID]);
         }
       }
     }
@@ -664,4 +664,4 @@
 
     this.validateRows();
   }
-});
\ No newline at end of file
+});
