The complexity of complex return types – Looping a record return type (extended)

Short post

Do you remember my post about The complexity of complex return types?
And the update The complexity of complex return types (updated) – Looping a record return type?

Well, since the release of Microsoft Dynamics 365 Business Central 18.4, I have a another update for you! Let’s call it an “extension” for the update 🤪.

As I mentioned in the second post that it actually WAS possible to loop a returned record by using the GetView/SetView methods.

Since 18.4, the signature of the “Record.Copy” method is changed, where the “ByRef” is removed. So now, we could also use the more intuitive “Copy” method, to implement the loop:

You’ll need the new compiler (the latest AL Language extension (7.4.496506) seems to already support the new signature), and the application needs to be on the 18.4 platform, obviously.

Thanks Natalie, for keeping a close look at all these GitHub issues 😉

5.00 avg. rating (97% score) - 1 vote

Permanent link to this article:


    • Amirsa on August 27, 2021 at 12:53 pm
    • Reply

    I often use this copy method on my procedures on nav until bc 18.2 And i nevetr had issues on a loop. Did i misiunderstood the post

      • waldo on August 27, 2021 at 12:54 pm

      Probably not.
      Thing is that we now can use this in combo with a Record as return type. Prior, that was not possible.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.