Christmas wish – Dynamics NAV QueryRef object

I would like to see a QueryRef object in NAV.  This object would be similar to RecRef from a developer point of view.

We would be able to create a QueryRef from any query.  QueryRef would then behave similar as a RecordRef, meaning that we would be able to use commands like these.

QueryRef

Behind the scene I would suggest that NAV starts to use the tempdb database. When a QueryRef.OPEN(QUERY::”VAT Entries Base Amt. Sum”) is executed I would like to see a temporary table created in the tempdb database and it would be populated with the SQL command INSERT INTO including all the rows returned by the SQL query.

At this stage everything that is done to a regular NAV table can be done with this tempdb table.  That includes being able to use this in a Page.

QueryInPage

A QueryFieldRef is also required with similar functionality as FieldRef.  You get the point…

Selection Filter to Clipboard

I have now seen three posts about using Excel to help create a Pipe Filter.  The latest one from Mohana is similar to the way I normally do this.  His post is a followup from the original video from Kerry Rosvold and an alternative from Mark Brummel.

If this is something you frequently need to do, why don’t use NAV and skip the Excel part ?

Lets imagine how that could look like.

CustomerList

We add a button the ribbon, select what ever we like from the customer list and click the button.

Clipboard

Now it just a matter of using the filter. Paste it where ever you need it.

FilteredCustomerList

And this is with just a few lines of code.

CustomerListModification

Page21 Delta file