Views:

Applies to Product – Dynamics 365 Finance


What’s happening?
Users encounter a SQL error when attempting to post vendor invoices in the production environment. The error message indicates an issue with a temporary table in the database, specifically mentioning invalid object names and temporary connection problems. Additionally, a similar error occurs in Power Automate when posting a journal line if a different entity is used in the Company Code field other than a specific predefined value.


Reason:
This arises due to incorrect handling of invoice quantities during posting. Specifically, the invoice quantity being posted does not match the quantity received in the product receipt, leading to inconsistencies and subsequent SQL errors.
Additionally, the error in Power Automate occurs when using a Company Code other than the one linked to the first part of the Journal batch number, indicating a possible linkage or restriction in the journal batch numbering system.


Resolution:
To resolve the vendor invoice posting SQL error, follow the correct invoicing process:

  1. Create a purchase order with the intended quantity and confirm it.
  2. Receive the complete quantity.
  3. When invoicing, if you change the invoice quantity to a value less than the received quantity, a pop-up message will appear stating:
"The invoice update quantity is less than the quantity of the matched product receipts. Matched product receipt quantity will be invoiced and won't be consistent with the quantity in the invoice. Use the 'Product receipt quantity to match' field in the product receipt page to adjust the quantity that will be invoiced."
  1. Click Cancel on the pop-up message.
  2. Click on Product receipts Quantity and adjust the "Product receipts Quantity to match" to the quantity you intend to invoice.
  3. Click OK.
  4. Post the invoice with the adjusted quantity.
If transactions have already been posted incorrectly, reverse them by: - Creating a new purchase order with the same details but with a negative quantity. - Follow the same incorrect process used initially to reverse the problematic transactions. - After reversing, create a new purchase order with the correct details and follow the correct invoicing process described above.
For the Power Automate issue related to posting journal lines: - Verify if the Company Code is linked to the first part of the Journal batch number. If so, ensure that the correct Company Code (e.g., 1004) is used for these records. - Trace the code to confirm the linkage between the Company Code and the Journal batch number, as this may restrict posting to specific Company Codes.
If further troubleshooting is required, tracing the code may be necessary due to limited access in Development Cloud Hosted Environments.