How to SetCurrentKey to Sort in a RecordRef – Nav / D365 Business Central

Recently I had the need to use a Secondary Key to sort a RecordRef. As I could not find another clear example, I decided to share my solution here. Introduction To make it easier to understand, let’s assume we have this Test table with only 2 fields, both Integers just to simply the example: The…