Hi. I need to add a permanent filter to a report - so that the report only picks up records where the due date for an invoice is within the current month and it is in the open state. I am very new to NAV and have been trying to use CM for current month - but it doesn't like it.
Any pointers would be appreciated.
0
Answers
DateREC.RESET; // DateRec is a record on virtual table "Date"
DateREC.SETRANGE("Period Type",DateREC."Period Type"::Month);
DateREC.SETFILTER("Period Start",'..%1',DMY2DATE(1,DATE2DMY(TODAY,2),DATE2DMY(TODAY,3)));
DateREC.FINDLAST;
FILTERGROUP(10); // necessary to avoid that user puts another filter on it and only 1 of them is taken
// Putting it in another filtergroup makes sure both filters are used
SETFILTER("Due date",DateREC."Period Start",DateREC."Period End");
FILTERGROUP(0);
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Sorry as I said in my original post very new to C/SIDE and C/AL!
Cust. Ledger Entry - OnPreDataItem()
SETFILTER("OPEN",'YES'); //filter to pick up only open documents
SETFILTER("Document Type",'Invoice'); //filter to pick up only Invoices - not credit notes or payments
SETFILTER("Due Date", ''); //filter to ensure Due date is within the current month - at moment just blank.
Thanks for the code!