{IF (CALCDATE(ReminderLevel."Grace Period",ReminderDueDate) < ReminderHeaderReq."Document Date") AND ((LineLevel <= ReminderTerms."Max. No. of Reminders") OR (ReminderTerms."Max. No. of Reminders" = 0))}//OLD CODE //NEW CODE //Roliveira 2019-07-11 IF ((CALCDATE(ReminderLevel."Grace Period",ReminderDueDate) < ReminderHeaderReq."Document Date") AND ((COPYSTR(CustLedgEntry."Document No.",1,4)<>'FTVS'))AND ((COPYSTR(CustLedgEntry."Document No.",1,2)<>'VD'))) AND (((LineLevel <= ReminderTerms."Max. No. of Reminders") OR (ReminderTerms."Max. No. of Reminders" = 0)) AND ((COPYSTR(CustLedgEntry."Document No.",1,4)<>'FTVS'))AND ((COPYSTR(CustLedgEntry."Document No.",1,4)<>'NCVS'))) OR ((COPYSTR(CustLedgEntry."Document No.",1,4)='FTVS') AND (TODAY-CustLedgEntry."Posting Date" >180)) AND ((COPYSTR(CustLedgEntry."Document No.",1,2)<>'VD')) AND ((COPYSTR(CustLedgEntry."Document No.",1,4)<>'NCVS'))
Answers
LOCAL FilterCustLedgEntries(VAR ReminderLevel2 : Record "Reminder Level")
CustLedgEntry.SETFILTER("Document No.",'<>%1|<>%2','VD*','NCVS*');
IF COPYSTR(CustLedgEntry."Document No.",1,4)='FTVS' THEN
IF (Today-CustLedgEntry."Posting Date" >180) THEN...
But it keeps me showing and calculating some Invoices that doesn't respect the 180 days condition