Date filer on flowfiled

I d like to know, does it possible or how can I set last starting date on flowfield of table.

I d like to know how can I set last starting date on flowfield of table

Can you explain what you mean by “last starting date”

So, I have in table 50003 (Agreed Item Unit Cost) more than one Unit Price for the same item with the different date like (1/1/05 → 0.04€ ,1/1/06 → 0.05€, 1/1/07 ->0.055). One of the field of table is starting date which discribe date of change unit price. I’m going to create flowfield in table 5406 (Prod. Order Line) which include the last starting date (lastest date) of item in table 50003.

Sure, in your flow field formula, use the “Method = Max”

I was used

Method …Max

Table …Agreed Item Unit Cost

Filed …Unit Price

How can I set Table Filters??? Maybe is wrong something else, because doesn’t work.

Sorry David, I give you wrong instruction, because I’d like to have FlowField in table 5406 wich include last unit price from table 50003.

I have problem with last date on flowfield. So, in table 5406 i was create new flowfield with name material price which is related with table 50003 (Agreed Item Unit Cost). In table 50003 I have different prices for the same material. In table 5406 on new flowfield material price I’d like to have last price. That means, that last price also have last date. For this reasons, I need in T5406 to set flowfiled whic found in T5003 last date for material price. Maybe some idea?

I personally would not use a flowfield, but instead would create a function on the table that filters as needed, making sure that the Setcurrentkey uses the date as the part of the key stright after your filtered fields. Then if using 4.02+ I would use the function FindLast

Do it would be

Setcurrentkey(Field1,field2,DateField);

Setrange(Field1,Variable1);

setrange(field2,Variable2);

If Findlast then

Exit(“Last Date”)

else

Exit(“0D”);

/TH

Duplicate post merged to original post incase it has further information.

Please Simonoman, in future its easier to add additional information to your existing thread than to start a new one, this only causes confusion, since people reading the thread do not know the history.

TNX TH,

I 'd like to thank your sugestion, but I don’t know where in table I able to make filter. So, in table 50003 I have field Startig date. Maybe OnValidate of Starting date. If I understand you I have to first of all in table 50003 create code for filtering my last date of Materila price. Then in table 5406 read that value. I using 4.0 SP1. Also, I’d like to plese you, if you write down me step by step procedure how can I manage it.

Simon

David,

I’d like to apology of my mistake duplicating of post. Thanks

There are a number of ways of doing this. most important is : “how are you going to use this” is it for some calculations in code, or is it just to display on a form. Because if you are already writing code,then do what Tony suggests, but if its on a form, then use a flow field.

Also why are you using a new table, and not using the standard Navision costing tables?

I suggested that he use the code as my understanding is the new FindFirst FindLast functions do a Select Top 1, Select Bottom 1, and are more efficent SQL statements. Of course my assumption is that’s its >4.02 SQL [:|] (Assumption the mother of all…)

/TH