web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Error while Preview Posting Purchase Invoice.

(5) ShareShare
ReportReport
Posted on by 236
Hi Team,

I am facing an issue in Microsoft Dynamics 365 Business Central while posting a Purchase Invoice. Below are the steps I followed:
 
1. I created two Purchase Orders with the same Vendor & same Location Code and both POs are in Released status.
2. I created a Warehouse Receipt with same location and selected both Purchase Orders as Source Documents.
3. I posted the Warehouse Receipt successfully.
4. After that, I created a Purchase Invoice for the same Vendor.
 
In the Purchase Invoice, I used Get Receipt Lines and selected the Posted Purchase Receipt Lines that were created from the Warehouse Receipt.
When I try to Preview Posting the Purchase Invoice, I get an error also attached error log file.

Is there any setup missing Please advice how to resolved this issue.


I have the same question (0)
  • Suggested answer
    OussamaSabbouh Profile Picture
    10,875 Super User 2026 Season 1 on at
    Hello ,
     
    This is a known Tax Engine bug during Preview Posting when one Purchase Invoice includes multiple receipt lines from different POs.
     
     
    Skip Preview Posting and post directly, or
     
    Invoice each PO/receipt separately
     
     
    No setup is missing.
     
    Regards,
    Oussama Sabbouh
  • Suggested answer
    Aman Kakkar Profile Picture
    2,977 Super User 2026 Season 1 on at
    Hi,
     
    Did you try - One invoice per receipt/PO? Or is it giving the same error?
     
    Also, is this issue coming while Posting the invoice also? Or only during the Preview Posting?
     
    From the error logs - 
    • Preview Posting runs posting logic in simulation mode
    • The Tax Engine tries to Insert or modify Tax Subledger / Tax Posting Buffer.
    • During preview, those records are temporary / not opened.
    • A Modify() or Insert() is executed anyway.
    • AL runtime throws “The record is not open”.
     
    The stack trace is 100% Microsoft code. You can try using debugger to check the values in the stack variables to get to know the real cause.
     
    Hope this helps.
    Aman K
  • Suggested answer
    YUN ZHU Profile Picture
    97,970 Super User 2026 Season 1 on at
    It appears to be a Microsoft issue; I suggest submitting it directly to Microsoft.
     
    Thanks.
    ZHU
  • Suggested answer
    CU08050848-0 Profile Picture
    236 on at

    Hello Oussama Sabbouh,

    Thanks for your reply.

    I am facing the same error when clicking the Post button as well.

    I have two sandbox environments: one is Development and the second is UAT.

    The above scenario is working fine in the Development environment, but I am facing the issue in the UAT environment.

    In the Development environment, both Post and Preview Posting are working fine.

     

  • Suggested answer
    CU08050848-0 Profile Picture
    236 on at
    Hello YUN ZHU,
     
    Thanks for your reply.
     
    I am facing the same error when clicking the Post button as well.
     
    I have two sandbox environments: one is Development and the second is UAT.
     
    The above scenario is working fine in the Development environment, but I am facing the issue in the UAT environment.
    In the Development environment, both Post and Preview Posting are working fine.
  • Suggested answer
    Alex A Profile Picture
    3,003 Super User 2026 Season 1 on at
    Don't use a Purchase Invoice and Get Receipt Lines for the POs that have been received.
     
    You should be posting the invoices directly from the Purchase Orders, by posting the Purchase Orders themselves.
     
     
     
    Regards,
     
     
    If this lends to your success please mark the answer.
  • Suggested answer
    RockwithNav Profile Picture
    8,846 Super User 2026 Season 1 on at
    Alright so if its working on one environment than it should work on different as well.
    Some permutation combination you can try - 
     
    • Create the exact same PO on the other environment with same qty and vendor, exact replica and see the behavior.
    • I am assuming same extension  is there , no possibility of code changes.
    • Try creating PO with different Vendors and Item, just to make sure that the corresponding item is not the culprit.
     
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,161 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,046 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 932 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans