This is the code and when system hit the DELETEALL function, I am getting "The 'record' already exists. Identification Fields and Values: <All the filter values here>"
NOTE: pblnDeleteAll is false.
lrecRentalComments.SETRANGE("Document Type", "Document Type");
lrecRentalComments.SETRANGE("Document No.", "Document No.");
lrecRentalComments.SETRANGE("Line No.", "Line No.");
IF NOT pblnDeleteAll THEN
lrecRentalComments.SETRANGE("Copied from Equipment",TRUE);
lrecRentalComments.DELETEALL;
NOTE: pblnDeleteAll is false.
lrecRentalComments.SETRANGE("Document Type", "Document Type");
lrecRentalComments.SETRANGE("Document No.", "Document No.");
lrecRentalComments.SETRANGE("Line No.", "Line No.");
IF NOT pblnDeleteAll THEN
lrecRentalComments.SETRANGE("Copied from Equipment",TRUE);
lrecRentalComments.DELETEALL;