Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Business Central forum
Under review by Community Managers

Under review

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

Custom Page API as Virtual Table in Dataverse

Posted on by 60

I am trying to expose fields that are not exposed in the OOB API in Business Central.  Specifically the ItemLedgerEntry.  I can create a custom page and expose it as a custom API, and create the table in the Dataverse, but I get OData errors when reading data.

I cannot think of another approach as I don't need a custom table I need a built-in table, just the default API does not expose the Lot No.

The AL source is posted below.

page 50101 ItemLedgerEntryPage
{
    PageType = API;

    APIVersion = 'v2.0';
    APIPublisher = 'My Company';
    APIGroup = 'MyCompany_API';

    Caption = 'Item Ledger Entry With Lot';
    EntityName = 'itemLedgerEntryWithLot';
    EntitySetName = 'ItemLedgerEntryWithLot';

    ODataKeyFields = SystemId;

    SourceTable = "Item Ledger Entry";

    DelayedInsert = true;
    InsertAllowed = true;
    DeleteAllowed = false;
    ModifyAllowed = false;

    layout
    {
        area(Content)
        {
            repeater(General)
            {
                field(id; rec.SystemId)
                {
                    ApplicationArea = All;
                    Editable = false;

                }
                field(itemNo; Rec."Item No.")
                {
                    ApplicationArea = All;
                }
                field(description; Rec.Description)
                {
                    ApplicationArea = All;
                }
                field(lotNo; Rec."Lot No.")
                {
                    ApplicationArea = All;
                }
                field(qty; Rec.Quantity)
                {
                    ApplicationArea = All;
                }
                field(cost; Rec."Cost Amount (Actual)")
                {
                    ApplicationArea = All;
                }
                field(entryType; Rec."Entry Type")
                {
                    ApplicationArea = All;
                }
                field(documnetNo; Rec."Document No."{ }
                field(documentType; Rec."Document Type"{ }
                field(entryNo; Rec."Entry No."{ }
                field(salesAmount; Rec."Sales Amount (Actual)"{ }
                field(sourceNo; Rec."Source No."{ }
                field(sourceType; Rec."Source Type"{ }
                field(jobNo; Rec."Job No."{ }
            }
        }
    }
}

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,267 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,017 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans