Hi,
I have a "Date Filter" defined as Flowfilter in a table
Does this line of code work in a codeunit???
SETRANGE("Date Filter",ldateFirstDate,ReportingDate);
if i do the same thing in a report, it works fine..
can any1 tell me y it doesnt work in a codeunit??
0
Comments
Have you debugged your code to see the values?
It should work...
in the codeunit, i use the Date Filter which is a flowfilter, to calculate the sum between two dates.
Below are the codes..
WITH lGenProdPostGrp DO BEGIN
SETRANGE("Job Filter",pJob."No.");
//first date of the month
lintMonth := DATE2DMY(ReportingDate ,2);
lintYear := DATE2DMY(ReportingDate ,3);
IF lintMonth < 10 THEN
ltxtMonth := '0'+FORMAT(lintMonth)
ELSE
ltxtMonth := FORMAT(lintMonth);
EVALUATE(ldateFirstDate,'01'+ ltxtMonth + FORMAT(lintYear));
IF ReportingDate <> 0D THEN
SETRANGE("Date Filter",ldateFirstDate,ReportingDate);
MyDate := CALCDATE('-CM',ReportingDate);
Does your filter get the values you specify?
Have you included the date field in the formula of the flowfield?
Also do you call CALCFIELDS after applying the filters?
use here the '<' and the '>'. So your source works also on other systems with other languages. Because the '<' '>' defines the NAV Standard source.
Your FlowField would be calculated, if you calcfield is also after setting the filter.
Regards
WITH lGenProdPostGrp DO BEGIN
SETRANGE("Job Filter",pJob."No.");
IF ReportingDate <> 0D THEN
SETRANGE("Date Filter",CALCDATE('<-CM>',ReportingDate),ReportingDate);
and miraculously :-) it worked..
Thanks guys