Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Pulling Specific Vendor smartlist

(0) ShareShare
ReportReport
Posted on by 5

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,

  • Suggested answer
    keoma Profile Picture
    32,727 on at
    RE: Pulling Specific Vendor smartlist

    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;

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 953

#2
YUN ZHU Profile Picture

YUN ZHU 887 Super User 2025 Season 1

#3
Mansi Soni Profile Picture

Mansi Soni 602

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans