NAV 2009: SETRANGE and RecordID

I think to remember that RecordID here just introduced in Dynamics NAV 2009. Here it were used in the Record Link table for the first time.

Well I'm working on a customer who is still on NAV 2009 R2. And I'm trying to use RecordID. But it surely doesn't work the way I've gotten used to in NAV 2016 and NAV 2017.

A simple thing I can't get to work is a simple SETRANGE("Record ID",RecID). If that doesn't work, then it's really like all the fun of using RecordID and NAV 2009 goes away!

Can anyone clarify this to me?

  • Hi Erik,

    well... you can't. Only thing you can do is GETRECORD, which gives you a RecRef of the RecordID. That's something.

    with best regards


  • In reply to jglathe:

    Thanks Jens. I kind of had came to that conclusion. Nothing except getting and setting works.
    So it means back to the drawing table...
    Just hate working in the old C/SIDE editor, once used to the "new". And not talking about VSCode...
  • In reply to Erik P. Ernst:

    Well did a bit more research and trial-and-error, and it actually is possible to filter on RecordID in NAV 2009.

    At least the 2009 R2.

    Here it is possible to filter, but not using SETRANGE. Instead you have to use SETFILTER like:



    Also played around with the limitations of variants in 2009! Cannot use a variant directly in a parameter, must assign records to a variant variable and assign that to the function.