HI!
We are trying to figure out how to pull a list of our most used vendors for the last year to make labels for filing purposes.
We would like to pull vendors that have been paid more than 3 times or had more than 3 invoices in the last year but we cannot seem to figure out how. We cannot do by $ amount as this varies too much. When doing by invoices paid YTD greater than 3 it is pulling vendors with only 2 invoices... not sure if it is pulling from Jan-Jan or our fiscal year. Looking for other options to filter by.
Help is appreciated.
Thank you,
you may need a new report on base of tables vendor and "vendor ledger entry", filtered by document type=invoice.
create a report with dataitem Vendor, add the needed fields
add following code in trigger onprereport:
//variables
vle : record . vendor ledger entry
startDate: date
NoOfInv: integer // default value 3, set in request page
startDate := CALCDATE('-1Y',TODAY);
vend.FINDFIRST;
REPEAT
vle.SETRANGE("Posting Date",startDate,TODAY);
vle.SETRANGE("Document Type",vle."Document Type"::Payment);
vle.SETRANGE("Applies-to Doc. Type",vle."Applies-to Doc. Type"::Invoice);
vle.SETRANGE("Vendor No.",vend."No.");
vle.SETFILTER(Amount,'>%1',0);
i := vle.COUNT;
IF i >= NoOfInv THEN BEGIN
Vendor.COPY(vend);
vend.CALCFIELDS(Balance);
Vendor."Budgeted Amount" := vend.Balance; // save the balance
Vendor.INSERT;
END;
UNTIL vend.NEXT = 0;
Sohail Ahmed
953
YUN ZHU
887
Super User 2025 Season 1
Mansi Soni
602