In Dynamics NAV reports we use SetData and GetData functions to retrieve data certain data in page headers and footers due to different scopes. In this blog post I’m not going to explain why and how but I’m going to give links to some good posts that does it at the bottom this post. Instead I’m going to give you a tip on how to make the process of adding/finding which data that has a certain index in the SetData function call by using line numbers.
Category Archives: Okategoriserade
If you are having the need to use DotNet in an older client such as Dynamics NAV 2009 R2 you will problably run into troubles which they have fixed for later versions of Dynamics NAV. I had the problem that I tried to downgrade code using the DotNet type System.String. I didn’t get very far until the compiler started to complain…
In the classic version we could run tables straight from the object designer and the object designer was always included in the client. In the Role Tailored Client (RTC) however we don’t have an object designer. Instead it is located in the developement environment. But sometimes you need to run a table but you don’t have access to the development environment (end user computer, ClickOnce and so on..).
So what to do then?
In the pre RTC versions of Dynamics NAV it was really simple to run/view objects from the client. Nowadays when we are using RTC it is not quite that simple since by standard we don’t have object designer in RTC (Role Tailored Client). At least yet 🙂
But there is a trick that you can use to achieve this. You need to create a page on the table object. After that add a button that runs the current record. Microsoft described this a couple of years ago in a blog post (How to start any object in Role Tailored Client)
But how about tables and querys?
The last couple of years I have started to use an new trick to make my everyday life with Dynamics NAV easier.
Usually I have the problems like this:
- How do I easy see all the locations of a certain field name in the database?
- How can I quick look up a datatype for a certain field?
- How can I quick see if a field is a flowfield?
- How can I search on database fields using captions?
For me the solution became to make a page on the virtual table field (How to: Create a Page to View a Virtual Table).This is real handy when you have an addon table with 355 fields were the captions don’t really match the field names.
Earlier today I wrote a blog post XMLPort: Export from temporary tables. The principle is the same when you want to import to a temporary table. Instead of calling a function in XMLPort before you call the export that inserts values into the temporary table you do the opposite, call a function after the import has completed that copies all the temporary data to your temporary record parameter. Read the rest of this entry »
You can export data from tables to XML by using XMLPorts. But you can also use XMLPorts to export data from temporary tables.
The principle is to set the Temporary property on the table line and then create a function in XMLPort that inserts all the data into the temporary record.