Skip to main content

Notifications

Announcements

No record found.

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

API - calculate field?

(1) ShareShare
ReportReport
Posted on by
I am wanting to do an API to get the item quanitity for a specific site, but then subtract the /qty on sales order/ from that amount. Is that possible within the below API?
 
query 50002 /SQ Inventory Quantity/
{
    QueryType = API;
    APIPublisher = 'Name';
    APIGroup = 'CustomAPI';
    APIVersion = 'v2.0';
    EntityName = 'inventoryQty';
    EntitySetName = 'inventoriesQty';
 
    elements
    {
        dataitem(Item; Item)
        {
            column(No_; /No./) { }
            dataitem(Item_Ledger_Entry; /Item Ledger Entry/)
            {
               
                DataItemLink = /Item No./ = Item./No./;
                DataItemTableFilter = /Location Code/ = const('MAIN');
                column(Location_Code; /Location Code/) { }
                column(Quantity; /Quantity/)
               
                {
                   
                    Method = Sum;
                }
            }
        }
    }
}
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 75,561 Super User 2024 Season 2 on at
    API - calculate field?
    Unfortunately this is not possible if you use Query. Because you cannot add calculations in Query.
    You need to create a Page api.
     
    And hope the following vedio can give you some hints
     
    Thanks.
    ZHU

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,622 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,354 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans