setCurrentKey no longer crashes if missing

txerifftxeriff Member Posts: 492
edited 2021-11-18 in NAV Three Tier
Hi all,
I just want to confirm something.

I would say in old nav versions if they key didnt exist it simply used to fail. It seems like, now it searches for best ocurrence of index fields for the given setcurrentkey:

Strange also, I tried random fields not included in any key and it always returns "true" for:
[Ok := ]  Record.SetCurrentKey(Field1: Any [, Field2: Any,...])

I even tried a calcsums and it worked.


  • bbrownbbrown Member Posts: 3,268
    Correct. You do not need to have a matching key. This has been for several versions
    There are no bugs - only undocumented features.
  • txerifftxeriff Member Posts: 492
    Yeah, thanks. later on I´ve found a document, seems like this started with NAV 2016. The risk here is you forget about creating the key, I would prefer it to fail or maybe an extra parameter true/false to "force" match they key.
Sign In or Register to comment.