In NAV 2015 I by accident used SETCURRENTKEY with a key that not existed. When I ran the codeunit no errors occured.
When I look at the documentation it says
"If no keys can be found that include the fields that you specify, the return value is FALSE. If you do not test the return value, a run-time error occurs. If you do test the return value, the program will continue to run even though no key was found."
If I create a simple table with id and name the code below will return True (in 2013 R2 and 2015) no matter what field I select as key. In 2009 it behaves as the documentation.
keyworking := r.SETCURRENTKEY(name2); MESSAGE(FORMAT(keyworking));
Is this a bug or is the documentation not up to date?
*This post is locked for comments
With the introduction of Dynamics NAV 2013 R2 version interactive soring feature was introduced to Dynamics NAV. Therefore you no longer required to define a key in the table level to sort it in the run time. You can sort the data with any field.
Hi
From Nav 2013 R2 with the Introduction of Interactive soring feature, it is no longer required to define a Key on a table to sort data. SetCurrentKey no longer requires a Key to be created in the table.
refer the below for details
https://markbrummel.wordpress.com/2013/10/23/nav-2013-r2-keys-keygroups-and-setcurrentkey/
https://markbrummel.wordpress.com/2013/09/10/nav2013r2-interactive-sorting/
Its not a bug, seems to be the document not updated
Best Regards
Rajasekhar.Y
Sohail Ahmed
2
mmv
2
Amol Salvi
2