1

When using AL there is a lot of code that does a check for existence of a record.

if not SalesLine.Get(DocumentType, DocumentNo, LineNo) then exit;


best practice for optimising code the suggestion is to use this

SalesLine.SetRange("Document Type",DocumentType);

SalesLine.SetRange("Document No.",DocumentNo);

SalesLine.SetRange("Line No.",LineNo);

if Item.IsEmpty() then exit;


it would be nice if IsEmpty accepted optional parameters that would set the key fields

if SalesLine.IsEmpty(DocumentType, DocumentNo, LineNo) then exit;


Less code to write and easy to understand and backwards compatible


Category: Development
STATUS DETAILS
New

Comments

G

if Item.IsEmpty() then exit;should be if SalesLine.IsEmpty() then exit;In the idea submission. I cannot edit the idea

Category: Development