Hi
I am using API itemLedgerEntries and when I am extracting this report from business central it provides two extra columns i.e Variant_Code and Location_code.
How can I get these two in itemLedgerEntries API.
Hi, Unfortunately, there is nothing you can do.
As shown below, API page type cannot be extended by creating a page extension object. Instead, you must create a new API by adding a page object.
So, you will need to follow the link provided by Inge and create a new API page to do so.
Here is the standard itemLedgerEntries page code that you use, hope it helps you.
page 30069 "APIV2 - Item Ledger Entries" { APIVersion = 'v2.0'; EntityCaption = 'Item Ledger Entry'; EntitySetCaption = 'Item Ledger Entries'; DelayedInsert = true; DeleteAllowed = false; Editable = false; EntityName = 'itemLedgerEntry'; EntitySetName = 'itemLedgerEntries'; InsertAllowed = false; ModifyAllowed = false; PageType = API; SourceTable = "Item Ledger Entry"; Extensible = false; ODataKeyFields = SystemId; layout { area(content) { repeater(Group) { field(id; SystemId) { Caption = 'Id'; Editable = false; } field(entryNumber; "Entry No.") { Caption = 'Entry No.'; Editable = false; } field(itemNumber; "Item No.") { Caption = 'Item No.'; } field(postingDate; "Posting Date") { Caption = 'Posting Date'; } field(entryType; "Entry Type") { Caption = 'Entry Type'; } field(sourceNumber; "Source No.") { Caption = 'Source No.'; } field(sourceType; "Source Type") { Caption = 'Source Type'; } field(documentNumber; "Document No.") { Caption = 'Document No.'; } field(documentType; "Document Type") { Caption = 'Document Type'; } field(description; Description) { Caption = 'Description'; } field(quantity; Quantity) { Caption = 'Quantity'; } field(salesAmountActual; "Sales Amount (Actual)") { Caption = 'Sales Amount (Actual)'; } field(costAmountActual; "Cost Amount (Actual)") { Caption = 'Cost Amount (Actual)'; } field(lastModifiedDateTime; SystemModifiedAt) { Caption = 'Last Modified Date'; } } } } actions { } }
Thanks.
ZHU
If you want to achieve that you need to develop a custom API as described here:
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,524 Super User 2024 Season 2
Martin Dráb 228,469 Most Valuable Professional
nmaenpaa 101,148