Zentriq Agent is live on Microsoft AppSourceInstall it free →Microsoft AppSourceInstall it free →

"Location Code must have a value in Item Journal Line: Journal Template Name=ITEM, Journal Batch Name=DEFAULT, Line No.=10000. It cannot be zero or empty."

Missing location code on a journal or document line

Business Central is telling you that the line has no Location Code and that the routine will not accept a blank one. This usually happens because Location Mandatory is switched on in Inventory Setup, or because the posting routine tests the field directly, as output and consumption journals do. Enter the location on the line, or set the right default so it fills in by itself.

Why Business Central raises this error

An inventory transaction has to say where the goods are, otherwise availability, warehouse handling and costing per location all become meaningless. Inventory Setup therefore offers Location Mandatory, which makes the field compulsory on inventory lines across the company, and several routines test the field regardless of that setting because they cannot work without it. The message is precise about where to look: it names the table and the primary key of the failing record, here the item journal template, batch and line number, so you can go straight to the line rather than hunting through the batch.

  • Location Mandatory is enabled in Inventory Setup and the line was left with a blank Location Code, often because the column is hidden on the journal.
  • The line was created by import, copy, a recurring journal or an integration that carries no location, or the customer, vendor or company setup provides no default location to inherit.
  • The line belongs to a routine that always needs a location, such as an output or consumption journal whose production order line, component or work centre has no location code.

How to fix it

  1. Read the key in the message, here Journal Template Name=ITEM, Journal Batch Name=DEFAULT, Line No.=10000, and open exactly that journal, batch and line.
  2. Make the Location Code column visible if it is hidden, then enter the location where the transaction really happens, and add Variant Code and Bin Code if the item and location use them.
  3. If the location should have filled in automatically, check the default location on the company information, on the customer or vendor card, or on the responsibility centre the user works in, so future lines inherit it.
  4. For an output or consumption journal, correct the location on the released production order line, its components or the work or machine centre, so the journal is recreated with the right location instead of patching each line.
  5. For a sales, purchase or transfer line, fill in the location on the document header before adding lines, so every new line inherits it, and correct the existing lines.
  6. Post again. Changing Inventory Setup or company-wide defaults requires setup permissions, so ask an administrator if those fields are not editable for you.

How to avoid it in future

The setting itself is worth keeping: without Location Mandatory, stock can be posted with no location at all, and the resulting quantities are hard to reconcile with what is physically on the shelves. The lasting fix is to make the correct location arrive by itself, through defaults on the company, on customers and vendors, and on responsibility centres, and to keep the Location Code column visible on the journals your team uses so a blank is obvious before posting. For recurring imports and integrations, set the location in the source or in the template rather than expecting users to catch it line by line.

Frequently asked questions

Can I just clear Location Mandatory in Inventory Setup?

An administrator can, and the error stops, but so does the guarantee that every inventory transaction says where the goods are. It is usually better to fix the defaults so the location fills in automatically than to remove the control that caught the blank.

Why do only some lines require a location?

The requirement applies to lines that move inventory. Lines for non-inventory or service items and general ledger lines do not need a location, while some routines, such as output and consumption journals, test the field even when Location Mandatory is off.

Related topics

Other Business Central errors