Skip to main content

Notifications

Small and medium business | Business Central, N...
Unanswered

Purchase Invoice API Issue: Total Amounts Zero with G/L Account

Posted on by 7

Hi Community,

I'm facing an issue while creating a purchase invoice with a G/L Account selected in the purchase invoice line. When I use the GET API for the purchase invoice, the following properties return a value of 0:

  • totalAmountExcludingTax
  • totalTaxAmount
  • totalAmountIncludingTax

Could you please let me know if I need to set up any changes or if there is another way to get the correct values for these properties through the API?

Thank you!

 
PurchaseInvoiceAP...
  • BS-27061404-0 Profile Picture
    BS-27061404-0 7 on at
    Purchase Invoice API Issue: Total Amounts Zero with G/L Account

    I'm using the standard API: https://{businesscentralPrefix}/api/v2.0/companies({id})/purchaseInvoices({id}).

    My purchase invoice line contains values. The API returns the accurate value when the purchase invoice line is an item. However, when the purchase invoice line is a G/L Account, it returns 0.

  • CU25061419-0 Profile Picture
    CU25061419-0 53 on at
    Purchase Invoice API Issue: Total Amounts Zero with G/L Account
    This value might be calculated at runtime, which is why it is showing up zero.

    Can you run RecordName.CalcFields('field name') and see if it populates the value.

    Sources: Record.CalcFields(Any [, Any,...]) Method - Business Central | Microsoft Learn
  • gdrenteria Profile Picture
    gdrenteria 12,167 Most Valuable Professional on at
    Purchase Invoice API Issue: Total Amounts Zero with G/L Account
    Hi
    Do you have amounts in the document lines?
    BR
    GR
  • Mohana Yadav Profile Picture
    Mohana Yadav 59,137 Super User 2024 Season 2 on at
    Purchase Invoice API Issue: Total Amounts Zero with G/L Account
    Are you using standard API or custom?
     
    I could not see your attachment for some reason, Please paste directly in the chat.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans