If you've worked with Dynamics NAV or Navision for a few years, then you properly already know at least one or two. Because they are many, the UNDOCUMENTED FEATURES and functions. They range from small helpful function which can be used without much documentation to larger functions, which really should be used without you understand them completly.
I have previously confronted Microsoft with some of these features. Their only answer was that they will not document them, because they this way don't have to tell us if they remove them! So they basically warn us from using them.
List of the Undocumented Features of Dynamics NAV
x += 1; or x -= 1;
One of my own favorites is the one above. It makes the old line like x := x + 1; or x := x - 1;
This function is available up to Dynamics NAV 5.0 (I have not tested it with version 2009).
So come on guys and girls, please share your knowledge about the undocumented features and functions that you know of exists in Dynamics NAV/Navision. When replying then please write if you know which versions the features are supported in, and if you know of any standard objects (or maybe add-ons) where this feature is used.
Best regards,Erik P. Ernst - webmaster at dynamicsuser.netMicrosoft MVP Dynamics NAV
Oh, oh. I didn't know that the syntax in your example (x += 1) is officially undocumented. I probably saw it in some existing code. There's so much stuff missing from or hard to find in the documentation, I just figured that it was OK to use.
Another nice trick:
If you know the field numbers of the table but not surely the field names, you can write your code based on the field numbers:
SalesLine.SETRANGE(Field1,SalesHeader.Field1);SalesLine.SETRANGE(Field3,SalesHeader.Field3);
If you save and close this code and open the object in Design Mode, you will see, that NAV replaced your Syntax by the field names:
SalesLine.SETRANGE("Document Type",SalesHeader."Document Type");SalesLine.SETRANGE("Document No.",SalesHeader."No.");
This also works for key definitions in the table designer, properties, which expect a field name (SourceExpr, TotalFields, ReqFilterFields, ...).
Yes this is also a good one. Just remember when if you have just created the fields (and have not saved and reopened the table designer in the meantime), that you will get a compilation error when you try to save it. But just save it without compiling and reopen again.
Another one in the same area is:
When creating ex. new keys, defining relationships between fields/tables, then you can also just enter the field no. instead of the full field name. The same goes to specifying tables. Just enter the table no. - just a shame that there are so many tables now - it was much easier back in the old DOS days, when one could remember almost all the standard table numbers!
Django Dunn:This one I learned from Navision Girl. In any text field you can type a question mark and press enter and the Standard Text window appears.
I beat my head against a wall everytime I find an end user whose Partner didn't tell them about this feature.
Also not only does the window pop up, if you type ? and the code it automatically iinserts the text. Cronus even has test data in it to test this.
FYI:
http://wiki.dynamicsbook.com/index.php?title=Standard_Text_table
http://plataan.typepad.com/microsoftdynamics/2008/06/import-fbk-undo.html
http://plataan.typepad.com/microsoftdynamics/2007/07/breakpoint-tabl.html (but this one is documented)
http://plataan.typepad.com/microsoftdynamics/2007/03/permission_rang.html
Searching field names in table designer
or import ONLY objects from a fbk(backup) file (oh i see it is mentioned in post below)
Or what about copy object from one database to the other with Copy and Paste
Select a table in Object DesignerSelect Copy Go to the other database (same version) object designerSelect paste(I think it is only working up to version 3.70 – then MS locked the designer)
Or
Copy and paste instead of Save as (objects)
1.Copy and Paste an existing objects in the object designer
2.Error message about the objects exist
3.It will be inserted anyway
4.Change the number
5.The object is copied
F3 in the object designer for create a new object
F3 in Form Designer for create a text box
okokok
not all of them are useful but anyway ..
ReGa: what about copy object from one database to the other with Copy and Paste(I think it is only working up to version 3.70 – then MS locked the designer)
what about copy object from one database to the other with Copy and Paste(I think it is only working up to version 3.70 – then MS locked the designer)
It still works, BUT the paste only works if you are currently on a 50,000-99,999 object. So to solve this in a new database, just create say form 99,000 put the cursor on that and hit paste.
ReGa:Copy and paste instead of Save as (objects)
I feel quite silly, but since ver 1.0 this is how I thought was the only way to "save as", since its the way I was shown in a class, and it was only about a year ago I was with someone training them, and they hit Save As, an option that I had NEVER seen before in NAV, and I could not believe it had been there since day one.
Scenary: You are sending out and update to your customer with new objects and asking him to install them himself. But as a good programmer you also like to clean up after yourself. So objects which are no longer used, should be deleted. One way of cause is to tell the user to do this. Another way is to like below:
In the Object Designer, ex. for tables. First delete the object you need to delete in your development database. Then you go down to the last entry of the Object list, then do not use F3 or new, but instead go down so that you can enter a new object number directly on the list. Enter the number of the object you want to delete! Give the objects names, date and version lists etc. - but DO NOT MODIFY the object with the Designer! This way the objects remain empty except for the header.
When you export the objects, then include these new "empty" objects.
When the user imports the objects, then they will automatically be marked for "Delete" in the Object Worksheet.
Of cause you need to make sure that if you do this with tables, that they are actually also empty from data before doing this!
This feature has worked since version 1 of Dynamics NAV, but as far as I remember then there has been a few versions in between where Microsoft locked this featured. But now again in NAV 5.0 it works.
Don't know if this is documented but saves me time:
When importing a fob with lots of objects you can filter the list down to the object(s) you need and it only imports them. No need to set the others to skip.
Is it a feature ? - it is a short cut - but nice to know.
Sometimes in developing it is necessary to reopen the database. -> Like example changing the CU 1.
The most developer closes the database or restarts the client.
Rene
Ps what about changing the topic to "best practice"? or new post?
Timo Lässer:SalesLine.SETRANGE(Field1,SalesHeader.Field1);SalesLine.SETRANGE(Field3,SalesHeader.Field3);
Also this works:
SalesLine.SETRANGE("1",SalesHeader."1");SalesLine.SETRANGE("3",SalesHeader."3");
And this for the options:
SalesLine.SETRANGE("1",SalesLine."1"::"0");
How to put a TAB or a CRLF in a text-string?
txtTAB := 'X';
txtTAB := 9;
txtCRLF := 'XX';
txtCRLF[1] := 13;
txtCRLF[2] := 10;