DeleteAll
Categories:
Created by waldo, Described by waldo
Description
When you perform a “DeleteAll” when there is nothing to delete, it will still perform a lock. When you for example perform a DeleteAll on an empty table, it will result in a table lock. Therefore it’s good practice to always check if the table is empty when performing a DeleteAll.
Bad code
EmptyTableWLD.SetRange(Code, 'AJ');
EmptyTableWLD.DeleteAll(true);
Good code
EmptyTableWLD.SetRange(Code, 'AJ');
if not EmptyTableWLD.IsEmpty() then
EmptyTableWLD.DeleteAll(true);
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.
Last modified October 4, 2024: Merge pull request #249 from Busschers/ErrorHandling-ListOfReferenceText (5e76983)
by Arend-Jan Kauffmann