Is it possible to use a flowfield as the basis for calculating another flowfield?
What I want is to do something like the following:
1. 'Line' table - has the flowfield 'First Date' which is the Min of the Posting Date for that Customer for that Line item. There can be multiple lines here with varying 'First Dates'
2. 'Header' table - I want to have a flowfield 'First Date' which is the Min of the Line 'First Date'
I know there are some other ways I can do this if this cannot work but I have not been able to find any documentation about whether this is doable or not.
Thanks,
Keith
0
Comments
1) it is slow
2) I am not sure the flowfield will take the real first date, it is possible it will take the first date of the first record.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
It depends what the actual question is.
1/If you mean "can you use the results of a FlowField as one of the "Table Filters" in another FlowField, then the answer is Yes, you do need to be careful to design it correctly (otherwise as Kriki mentions you can have performance problems), but I do this quite often, with no problems.
2/ If the question is "can I use One FlowField as the source Field for another Flow field, then the answer is" You are doing it the wrong way
The correct way is to redesign the Source Table to contain the Field that you are filtering and then use that as the filter on the main table. So in your case say you have a table called "Customer Line Item", and there is a many to one relation between "Customer Line Item" and Sales Line, but you need a flow field in Sales Header, then in the Customer Line Item table you add The Document No. (actually you probably already have that). And then just filter at header level using that.
Now a quick note of caution. There are two basic types of Flow field in Navision. Those that use SIFT technology, and those that use Lookup (oh and there is Average but lets ignore that).
The way that lookups, (Min, Max, Exist, Lookup etc) works has changed from time to time, Especially MIN/MAX. In earlier versions of Navision you had to have the entire filter AND the Source Field as a part of your key, and MIN/MAX did not really mean MIN/MAX, it actually meant "FIRST" and "LAST" so min would find the first record according to your sorting. This changed in a version (around 3.01 or 3.10 I think) to be a true Min /Max, which is slower, but more accurate. But now in 5.00 SQL it has gone back to the old way, so if the flow field selects the "wrong" key, it will return the wrong result. (As those running 4.00 eShip on 5.00 SQL exe will know) So often it may be safer to write this in code.
You're welcome, by the way, was it 1 or 2?