1
Hi All,
In the old nav versions if they key specified in SETCURRENKEY wasn´t found, it just raised an error. In new versions it tries to find closest key, even for calcsums()
https://docs.microsoft.com/en-us/dynamics-nav/setcurrentkey-function--record-

"but sorting without an index could lead to bad performance if a search returns a large result set, which would then have to be sorted before the first row is returned."

My suggestion is to add an extra paramether to the setcurrentkey "force key found" true/false:
[Ok :=] Record.SetCurrentKey(Field1, [Field2],...,TRUE/FALSE)

This will force NAV to find that particular key. This way, if you wish, you can always ensure you´ve created key.

Thanks.
Category: Development
STATUS DETAILS
Needs Votes
Ideas Administrator

Thank you for this suggestion! Currently this is not on our roadmap. We are tracking this idea and if it gathers more votes and comments we will consider it in the future.

Best regards,
Business Central Team