Difference in pass-by value vs pass-by reference in AL language
Important detail that caused me a bug recently and I want to share with others who are writing AL Code for Business Central.
When you pass a record to a procedure then you can do that either by pass-by value or pass-by reference.
When you have code like this:
CurrPage.SetSelectionFilter(ApprovalEntriesSelected); ApproveEntry(ApprovalEntriesSelected); and you pass-by value:
procedure ApproveEntry(Entry: Record "Approval Workflow Entry") then all filters are cleared on the record and you get a empty record on your procedure.
Published on:
Learn more