web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

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

Retrieve External Document No. of a Vendor Ledger Entry with API

(2) ShareShare
ReportReport
Posted on by 4
Hello, 
 
I'm trying to retrieve the External Document No. values of the vendor ledger entries.
 
To collect the entries, I have used the following endpoints : https://api.businesscentral.dynamics.com/v2.0/{{tenant_id}}/{{environment}}/ODataV4/Company('{{company_id}}')/VendorLedgerEntries/ and/or https://api.businesscentral.dynamics.com/v2.0/{{environment}}/api/v2.0/companies({{company_id}})/generalLedgerEntries
 
In the response model, the external number is not available but I can clearly see it in the UI. 
 
What calls should I make to have this information ? 
 
JSON Response : 
{
  "Entry_No": 1554,
  "Transaction_No": 618,
  "Vendor_No": "30000",
  "Posting_Date": "2025-04-07",
  "Due_Date": "2025-04-30",
  "Pmt_Discount_Date": "2025-04-07",
  "Document_Date": "2025-04-07",
  "Document_Type": "Invoice",
  "Document_No": "108210",
  "Purchaser_Code": "",
  "Source_Code": "ACHATS",
  "Reason_Code": "",
  "IC_Partner_Code": "",
  "Open": false,
  "Currency_Code": "",
  "Dimension_Set_ID": 4,
  "Amount": -240,
  "Debit_Amount": 0,
  "Credit_Amount": 240,
  "Remaining_Amount": 0,
  "Amount_LCY": -240,
  "Debit_Amount_LCY": 0,
  "Credit_Amount_LCY": 240,
  "Remaining_Amt_LCY": 0,
  "Original_Amt_LCY": -240,
  "Vendor_Name": "Graphic Design Institute",
  "AuxiliaryIndex1": "30000"
}
 
UI View : 
 
I have the same question (0)
  • Suggested answer
    DAnny3211 Profile Picture
    10,485 Moderator on at
    Retrieve External Document No. of a Vendor Ledger Entry with API

    Hi there,

    Thanks for your question! You're correct that the External Document No. field is visible in the Business Central UI, but not directly exposed in the response from the VendorLedgerEntries or GeneralLedgerEntries endpoints.

    Here's how you can retrieve it:

    1. Use the VendorLedgerEntries API with $expand

      • The External Document No. might be part of a related entity (e.g., the purchase document or invoice).
      • Try using the $expand query to include related entities
    /VendorLedgerEntries?$expand=Document
    1. Check for Custom APIs or Page Extensions

      • If the standard API doesn’t expose the field, you can:
        • Create a custom API page in AL that includes the External Document No. field.
        • Publish it via the API page object and access it through the same OData endpoint.
    2. Use the Web Client to Identify the Source Table

      • In Business Central, use Page Inspection (Ctrl+Alt+F1) on the Vendor Ledger Entry page to find the exact table and field name.
      • This helps confirm whether the field is part of the Vendor Ledger Entry table or linked from another source.
    3. Alternative: Use Power Automate or Power BI

      • If you're integrating for reporting, consider using Power BI or Power Automate to extract the data with richer field access.

    Let me know if this helps, and please mark the response as helpful if it answered your question 😊

    Best regards!

     
     
     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

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

#1
Jeffrey Bulanadi Profile Picture

Jeffrey Bulanadi 3,878

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 3,583 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 3,175 Super User 2025 Season 2

Featured topics

Product updates

Dynamics 365 release plans