Skip to content

Commit 032aa4e

Browse files
nanddeepnVesaJuvonen
authored andcommitted
Getting items by ID is unnecessary (SharePoint#4544)
Instead of using code: employeeList.getItemById(itemArray[i].get_id()).deleteObject(); we can use only this: itemArray[i].deleteObject(); because we've already got these items by the previous clientContext.executeQueryAsync(deleteCompletedItems, onGetCompletedItemsFail), and that's enough.
1 parent 59045b4 commit 032aa4e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/sp-add-ins/use-the-sharepoint-javascript-apis-to-work-with-sharepoint-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ Even though SharePoint-hosted SharePoint Add-ins cannot have server-side code, y
124124
125125
var i;
126126
for (i = 0; i < itemArray.length; i++) {
127-
employeeList.getItemById(itemArray[i].get_id()).deleteObject();
127+
itemArray[i].deleteObject();
128128
}
129129
130130
clientContext.executeQueryAsync(onDeleteCompletedItemsSuccess, onDeleteCompletedItemsFail);

0 commit comments

Comments
 (0)