Announcements
Hello all, I am a developer working on an integration with Dynamics AX. I am creating a non-PO based invoice in the system through a C# Web Service.
My issue is that I am defining the "PurchPrice" variable in the "AxdEntity_VendInvoiceInfoLine" of the request and can confirm it is being sent to the program, but when I view the invoice created in AX, the "PurchPrice" is 0. See below:
var lineItem = new AxdEntity_VendInvoiceInfoLine() { OrderAccount = "12345", ItemId = "454545", Description = "Television", ReceiveNow = 1, LineAmount = 499.99, LineAmountSpecified = true, PurchPrice = 499.99, PurchPriceSpecified = true, Closed = AxdEnum_NoYes.No, ClosedSpecified = true };
All other data that I am passing seems to be posting OK, and I can confirm that the "PurchPrice" field from VendInvoiceInfoLine" is the proper field because if I change the value in SQL after posting it, then it displays correctly.
I have also set the prices in the item itself within AX. I set the purchase price and attempted the posting again, but this value still posts as 0.
Can anyone provide guidance on what controls this value being set? Is there additional configuration in AX needed to set this price? Any help at all will be appreciated. Thank you!
Thank you so much for this response. I guess this was the issue! Passing only the quantity and purchase price automatically calculates the line amount and my purchase price is filling in now. I really appreciate the response!
Hi Evan,
When you have specified a line amount (LineAmountSpecified), then it is considering that there might be a rounding difference or lumpsum. This is then causing the unit price to be 0. Try to remove the coding for the line amount fields and let the application calculate the line amount.
André Arnaud de Cal...
294,099
Super User 2025 Season 1
Martin Dráb
232,866
Most Valuable Professional
nmaenpaa
101,158
Moderator