Context
Few days ago I created a NAV Report that did some checks and processing. After this, it uses a Temporary Data Item to print values in the layout for the user to see what records are updated or have issues.
Because of the complexity of the checks and processing I had to use a Data Item with property Temporary set to ‘Yes’ like this:
This means that the temp data item is empty by default and in order to use it, you have to insert records in it based on the needed conditions. Because it is temporary, the inserted records are not stored into the database. Instead, they are kept in memory as long as the variable is in scope. If you want to read more about temporary records in NAV, this is the best article I know until now.
Then, I also set up the SaveValues property on the Request page of the report to ‘Yes’. This is usually done in order for the report to be more user friendly.
When does a problem appear?
– > You use filters on the Request Page to filter the Data Item that is parent of the Temporary Data Item;
–> In some situations the Temporary Data Item will be wrongly filtered;
–> The wrong filters are based on values used in the past to filter the parent data item.
For example, in my case, the report was not printing information from the Temp Data Item. The data was correctly inserted in it before trying to print. But it was not printed because the Temporary Data Item contained wrong filters before the OnAfterGetRecord trigger was executed.(don’t know the explanation why this problem occurs)
Solution
The issue was solved by setting the SaveValues property on the Request Page of the report to ‘No’:
This is a bug from the NAV platform I believe, so if you encounter it, please note that the combination SaveValues property and Temporary Tables as Source Type of data items in reports gives trouble.