When researching the use of Sumindexes in SQL, i found that they are stored in a table with a name like Company$Tableno$KeyNo. When you look at such a table, you find that the columns in that table corespond to the fieldnumbers as defined in the key in navision. What I cannot figure out, is what the field "Bucket" is... Anyone have a clue?
It would be wise to persue this. If we can figure out exactly how the sumindexes are stored, we can probably use them in applications making use of the navision data.
Happy seeking... <img border="0" title="" alt="" src="images/smiles/icon_smile.gif" />
Dennis Decoene
Navision Software Engineer
MicroComputing NV
Nijverheidsweg 1
9820 Merelbeke
Belgium
Tel: +32 (0)9/231.26.88
Fax: +32 (0)9/231.77.57
http://www.microcomputing.be
Comments
John
Could you help me otu please? My time is running out...
The field being sumindexed can be used by more than one flowfield. Therefore you can't analyze by just set a single filter, as this doesn't change the definition of the flowfield.
Look at the definition of the flowfield. You will find the sourcetable (pad this with $n, where n is the sequencenumber of the sumindex of the sourcetable) and the parameters used for setting the sumindex conditions. It's the number of parameters that makes up the bucket number of filters. You need to pass a value for each filter (blanks if empty) to give the stored procedure the proper number of parameters. If you switch on SQL tracing, and call up a form containing the flowfield you want to use (make a temp form with only that field, to limit the amount of activity to monitor), you will be able to see the actual query for getting the value for that field. Copy the query and insert it in the Query Analyzer (? not sure about the name, but also under Tools in SQL Enterprise Manager) to play with values. Run the query and compare to the results you got from Navision. When everything is under control, you can copy the query to your program.
John
I'm doing my tests on the inventory field of the item table.
The calcformula is as folows:
Sum("Item Ledger Entry".Quantity WHERE (Item No.=FIELD(No.),Department Code=FIELD(Department Filter),Project Code=FIELD(Project Filter),Location Code=FIELD(Location Filter),Drop Shipment=FIELD(Drop Shipment Filter),Variant Code=FIELD(Variant Filter),Bin Code=FIELD(Bin Filter)))
As you can see, there are 7 filters defined. Yet when you look at all the rows in the SQL table company$32$0, you see there are 8 buckets. Now, when I set the location filter, the bucket in the analyzer is 4. When i set only the bin filter, it changes to 1. WHere is the logic in that????
Anyway, I'm going to do more tests when I find the time...
BTW, if you read this Marcus, my signature is updated <img border="0" title="" alt="" src="images/smiles/icon_wink.gif" />
Dennis Decoene
Navision Software Engineer
http://www.microcomputing.be