As part of our migration to Business Central online I've been writing integration applications to import invoice data into BC.
This involves registering endpoints on Page 43 - Sales Invoice and Page 47 - Sales Invoice Lines.
When it comes to posting the invoices into BC everything is fine, but when it comes to getting or reading back the invoice data I've discovered the information cannot be trusted and/or is tainted. I initially thought I was the problem with how I was interacting with the OData endpoints, but then I realised if I copied the OData V4 URL into my browser the data it returned was also wrong, so it must be coming out of Business Central incorrectly.
To replicate the problem you first have to ensure that the Business Central tenant your using has more than one invoice listed. Then take the OData V4 URL for the Sales Invoice Lines and paste it into a browser tab. You'll be asked to authenticate and you should use the user name and API key registered for web services.
When the results come back in the browser and providing your list returns more than *one invoice*, use the browser search tool and search the field [TotalSalesLine_Line_Amount] or [Total_VAT_Amount] or any field at the end of the Sales Invoice Lines for that matter. These fields should contain the line or document totals for Sales Invoices.
What we have discovered is these figures are wrong and always contain the value of the first invoice. These totals are replicated to all invoice lines even if you then filter the returning list to show only a single invoice.
It seems the only way to guarantee the document totals is to ensure only a single document is returned by the endpoint.
Can anybody confirm or deny our findings and suggest what's going on here. Is anybody able to communicate this to Microsoft?
Steve