In the classic client it was a requirement from a lot of end-users to easily count filtered records in a listform. This can be solved by adding a control with SourceExpr COUNT on the form.
Off course we should watch for performance but with Master Data this should not be an issue.
But now we have pages, so how can we implement that? It's not wysiwyg. Where do I put the control.
This is what I did:
In the List Page search for the end of the group repeater and add a new group group. In this group add a field with SourceExpr Count and add some captions.
This is the result:
This is just what I experimented and implemented, it is not supported by Microsoft!
I just finished my presentation at directions about Tips and Tricks in NAV 2009.
You can download the presentation and objects here.
There is a special announcement on the last slide.
I'll be honest, I found this out by accident lately but I want to share it anyway. Since it took me almost 15 years to find, it might not be know to some others.
As many of you know, using temporary tables in Microsoft Dynamics NAV is a very powerfull feature. We can use it to buffer data, to simulate SELECT DISTINCT etc. And they are free.
Using temporary tables becomes even more powerfull when adding an array to it. Let's see this in an example.
We'll create a new codeunit with a variable CustTemp that has two dimensions.
So now we can use CustTemp and CustTemp.
Let's write some C/AL Code with this.
We create a new record using CustTemp. We then try a FINDFIRST on CustTemp. Let's see what message we get.
How cool is this! The contents of the CustTemp is the same as that of CustTemp.
So what can we do with this. Let's add some more code.
We add a new record to CustTemp and filter on this value using CustTemp. Then we show the value of Name and the number of records in CustTemp.
What does this give?
The CustTemp now has the value of the Name we insterted in CustTemp. CustTemp ignores the filter we used in CustTemp.
Ok Mark, great stuff but what can I do with this?
Microsoft uses this in at least two places in the standard Navision product.
The fist place is the UpdInvPostingBuffer() function in Codeunits 80 and 90. This temporary buffer variable has two dimensions which are used to combine a select distinct with a total of the values.
The second place is the Inventory Profile Offsetting Codeunit (99000854) in Navision Manufacturing. In this codeunit supply and demand is created in the InventoryProfile table.
Today I've experienced something weird. Some weeks ago one of my customers did a technical upgrade from Navision 5 SP 1 to Navision 6 SP 1 (Aka NAV 2009 Classic Client SP1).
We decided to also move the Application Servers (Aka nassies) to a special server and to replace MiBuSo smtp with the newly introduced SMTP codeunit (400) in NAV 5 SP 1.
Now, this is a lot of changes... and off course something went wrong...
But this was not reported directly since the job that went wrong is still in development phase for end users to test. So after some weeks they said that a process was not running for a while. After investigation the error from the Job Queue was : You cannot use the file <<FILENAME>> because it is already in use.
This is where the reverse engineering process starts. What have we changed, did it ever work? With interfaces so much can go wrong.
I will not tell you the complete story, will be boring and take to long.
Short version: It seems that when you send a file with the SMTP codeunit (400) it will lock it, you cannot rename or delete the file. In this interface the filename needs to be exactly the same each time. This is why this interface fails and others like EDI and Order confirmations (without attachments) did not go wrong with the same SMTP function.
I am open for suggestions, meanwhile we moved this feature back to MiBuSo SMTP.