From version 15.0 of AL Extension there is a very cool and useful feature shipped!

Now its supported implicit conversion between Record and RecordRef instances, allowing direct assignment between these types.

So, it’s important that you have runtime 15.0 at least defined in your app.json:


Examples

Record to RecordRef:

Now two things here:

  1. Direct assignment to RecRef from Record

RecRef := Customer;

It would do same thing as Rec.Ref.GetTable(Customer);

2. Argument conversion, assign Record (Customer) to RecRef parameter ofthe procedure

RecRef to Record:

Also, two things here:

  1. Direct assigment of RecRef to Record (Customer)

Customer := RecRef;

Here the error will be thrown if RecRef is different table then Record to which RecRef is being assigned.

2. Argument conversion, call procedure which has Record (Customer) parameter with RecRef


This change makes work with the RecRef much easier now. Try it out! 🚀

Categorized in: