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

Receiving "Location does not exist error" in Business central while posting Sku'd item.

(7) ShareShare
ReportReport
Posted on by 34
Hello,
 
I'm receiving this error while trying to invoice a Sku item. The Location does not exist. Identification fields and values: Code=''
 
I can invoice it only if I use 'Receive and Invoice" function under Post.  If I only receive the item and later try to invoice, this error shows up.
 
I have checked Location codes on all items and they are all correct.
 
All answers are appreciated.
 
Thanks.
I have the same question (0)
  • Suggested answer
    OussamaSabbouh Profile Picture
    12,808 Super User 2026 Season 1 on at
    Hello,
     
    AI generation with ammendments:
     
     
    The error means BC is trying to read Location Code = '' (blank) during invoicing.
    It’s not the SKU itself – it’s a posting step where Location is empty, so Location.GET('') fails.
     
    Because Receive+Invoice works but Invoice-only fails, the usual suspects are:
     
     
    ---
     
    1. A blank Location somewhere in the chain
     
    Check all of these on the problem order:
     
    1. Purchase Header
     
    Fields: Location Code / Shortcut Location Code
     
    If Inventory Setup → Location Mandatory = TRUE, header or line must have a non-blank Location.
     
     
     
    2. Purchase Lines
     
    Make sure every item line still has Location Code filled when you try “Post → Invoice”.
     
    Sometimes users:
     
    Receive the order
     
    Then later clear/change the Location on the line or header
     
    Invoice → error appears because some logic now sees Location = ''.
     
     
     
     
    3. Posted Purchase Receipt
     
    Open the related Posted Purchase Receipt from the order (Line → Navigate / Receipts).
     
    Check that the Location Code on the receipt lines is populated and matches the current Location on the PO lines.
     
     
     
     
    If any line/receipt has Location = '', that’s exactly what triggers “Location does not exist. Code=''”.
     
     
    ---
     
    2. SKU vs Location mismatch
     
    Since it’s a SKU item:
     
    Make sure you actually use the Location Code of the SKU on the Purchase Line.
    BC doesn’t magically pull Location from the SKU if the line Location is empty.
     
    If Location Mandatory is on and a SKU exists for that item, but your line Location is blank:
     
    Receive+Invoice might still work (because it uses the line state at that moment)
     
    Separate invoice later hits code that checks Location and fails if it’s blank.
     
     
     
     
    ---
     
    3. Item Charges / Extra lines
     
    Check if the PO has:
     
    Item Charge lines or
     
    Non-Inventory / G/L lines
     
     
    Sometimes those lines inherit a blank Location Code. When invoicing only, BC still runs Location-related code (depending on your setup / extensions), and the blank Location on one of these lines can trigger the error even though the main item line looks fine.
     
     
    ---
     
    What I would do step-by-step
     
    On the same PO where you see the error:
     
    1. Make sure all lines (including Item Charges) have Location Code filled.
     
     
    2. Make sure the Purchase Header Location Code is not blank if you rely on header → line defaults.
     
     
    3. Open the linked Posted Purchase Receipt and confirm Location Code is populated.
     
     
    4. Try posting Invoice again.
     
     
     
    If it still fails after verifying all of that, it’s likely custom code or an extension around SKUs/locations. In that case, I’d next:
     
    Temporarily turn off extensions that touch locations/SKUs (if possible in a sandbox) and test.
     
    Or use the debugger on the purchase posting to see exactly which table/field is passing Code=''.
     
     
     
     
     
    Regards,
    AI generated
  • Suggested answer
    Teagen Boll Profile Picture
    1,401 Super User 2026 Season 1 on at
    You will want to check the posted purchase receipt and confirm if it has a location set on the lines. If it doesnt you will want to reverse that receipt and then update the invoice to make sure the invoice has a location set on those lines. That's usually whats happening when you get that error.
  • Suggested answer
    Gregory Mavrogeorgis Profile Picture
    992 Super User 2026 Season 1 on at
    Hi.
    This error usually means some part of the transaction has a blank Location Code, even if everything looks correct.
    What’s happening is:
    • When you do Receive & Invoice together, Business Central uses the location from the purchase order lines at that moment, so everything posts fine.
    • When you receive first and try to invoice later, Business Central uses the Posted Purchase Receipt Lines instead.
      If those receipt lines have a blank Location Code, the system throws exactly the error you’re seeing.
    1. Look at the Posted Purchase Receipt
    On the PO → go to Related → Receipts → open the receipt → check the Location Code on the lines.

    If you see a blank Location there (very common), that’s your culprit.
     
    2. Even if your PO lines look fine
    Sometimes the Location Code wasn't set at the time you hit Receive.
    Once that happens, the receipt gets created with a blank value and invoicing will fail every time.
     
    3. Also check
    • That the Location still exists (nobody renamed or deleted it)
    • That the PO line itself actually has a Location (not just the header)
    • That a SKU exists for that item + location if your setup requires it
     
    If you find this helpful please mark it as verified
  • Suggested answer
    YUN ZHU Profile Picture
    99,055 Super User 2026 Season 1 on at
    I suggest you debug this; it doesn't seem to be caused by the standard.
     
    Thanks.
    ZHU
  • Suggested answer
    Jainam M. Kothari Profile Picture
    15,732 Super User 2026 Season 1 on at
    Hello,
     
    This error occurs because the Location Code is missing on the purchase line when invoicing after a separate receipt. While “Receive and Invoice” uses the location from the receipt, posting the invoice later checks the Purchase Line Location Code, which may be blank if not set on the header or lines.
     
    Common causes include missing location setup, “Location Mandatory” enabled in Inventory Setup, or inconsistencies after partial receipts.
     
    To fix it, ensure the Location Code is populated on the header and lines before posting and verify warehouse/location settings are consistent.

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 1,926 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,158 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 533 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans