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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Dynamics 365 Business Central - Posting Order/Invoice issue

(6) ShareShare
ReportReport
Posted on by 14
 
 
Posting Preview for Order or Invoice with 1 line item post successfully
When adding more than 1 line items, posting preview fails with random number as below
 
The Sales Invoice Header does not exist. Identification fields and values: No.='***904557'
 
 
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    101,995 Super User 2026 Season 1 on at
    This appears to be a customization issue, possibly caused by the following, but I'm not entirely sure.
    Dynamics 365 Business Central: How to check if a record/table is temporary via AL
     
    It would be best to have the developers debug it.
     
    Thanks.
    ZHU
  • RL-03062108-0 Profile Picture
    14 on at
    There is no customization for sales quote, order, invoice
    1 field added for customer, and item master table, card, list/worksheet
     
    5 new tables added which are not temporary
    Later all custom tables are removed from customization and extension redeployed

    Posting ended up with same error
  • Suggested answer
    OussamaSabbouh Profile Picture
    17,586 Super User 2026 Season 1 on at
    Hello,
    Posting Preview should simulate the entries that will be created without needing an actual posted Sales Invoice Header to already exist, so this error usually points to custom code/event subscribers/reporting logic that is trying to Get() the posted invoice header during preview, using the temporary/random posting number generated by the preview process. Since it works with one line but fails with multiple lines, I would first check extensions/customizations around sales posting, invoice posting buffer/grouping, posting preview events, dimensions, item charges, or any subscriber that reads Sales Invoice Header too early. Standard troubleshooting: test the same document in a clean sandbox with extensions disabled; if it works, debug the custom extension and guard the logic during Preview Posting or avoid reading posted invoice tables before the real post is completed.
    Regards,
    Oussama Sabbouh
  • Suggested answer
    Valentin Castravet Profile Picture
    32,800 Super User 2026 Season 1 on at
    Agreed with Yun Zhu, this sounds like a customization issue. You can create a copy of the environment and completely remove the extension and see if that fixes the posting preview error. 
     
  • Suggested answer
    Teagen Boll Profile Picture
    3,187 Super User 2026 Season 1 on at
    Does this happen with all invoices or just a specific one? When an invoice or order line is created it automatically validates the header and adds it as a field to the lines section. The only way this could be overridden is with a customization of some kind. Or if lines were created in an irregular way.
     
    I'd try deleting any additional lines and try manually adding them back. Any new lines would include the header.

    If it persists i'd recommend submitting a ticket with Microsoft or getting your partner to submit one on your behalf as they can look at system issues if there was a bug.
     
    Best,
    Teagen Boll
    Social: LinkedIn
  • RL-03062108-0 Profile Picture
    14 on at

    I have created a new sandbox environment for this and configured again, but this time no extension.
    Same posting issue persist with Sales order or sales invoice preview posting
     
    Next i have created an invoice with 0.01 amount single line item and posted without preview posting.
    Now 1 dummy invoice is posted perfectly

    After this, I have created 1 more invoice with multiple line items and tested preview posting and it works perfectly
    Now I am not getting any posting or preview posting issue anymore
     
    This just happened and seems a quick work around, still root cause is not clear
     
     
  • Suggested answer
    Mansi Soni Profile Picture
    10,176 Super User 2026 Season 1 on at
    Hello,

    If you are still not able to find root cause you can take a help from technical expert and debug in the sandbox to find an exact root cause.
     
    Hope this answer helps you!
     
    If this answer helps you, kindly mark it as a verified answer.
     
    Regards,
    Mansi Soni
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    22,792 Super User 2026 Season 1 on at
  • Suggested answer
    Grigorios Mavrogeorgis Profile Picture
    2,514 Super User 2026 Season 1 on at
    Hi,
    the *** in the number is the giveaway — posting preview masks document numbers like that, so some code is trying to do a Get on the posted Sales Invoice Header during the preview, and in preview that record is never really there. Standard posting doesn't do this, which is why I'd bet on a customization or extension, usually a subscriber on one of the posting events that loops the lines and reads the posted header back. With one line it maybe never hits that path, with more lines it does.

    Quick test, try the same preview in Cronus or a company without your extensions, if it works there you found it. Then check your subscribers and wrap the Get with an if-Get, or skip it when preview is active. I seen this a few times and it was always custom code, never base app. Does real posting go through fine, and do you have any add-ons touching sales posting?
     
    Glad to help - follow up if anything is unclear.  
    ►  If this solved it, marking it verified helps others too.      
    Regards,
    Grigorios Mavrogeorgis
    Business Central Consultant & AL Developer

    Work: Gmsoft Limited
    Blog:  insidebusinesscentral
    LinkedIn: linkedin.com/in/gregorymavrogeorgis

     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,222 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,603 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 1,186 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans