The Job Inventory Problem | Part I

Last week I promised to blog about something less nerdy, something functional. Let’s see if I can keep that promise.

Since September last year I’ve had the honour of working on an upgrade project as functional/strategic consultant. The customer is upgrading from Microsoft Dynamics NAV 2017 to Business Central running in the cloud.

The NAV 2017 system is customized and there is an ISV solution that does not exist in AppSource. The goal of the project is to migrate to Business Central with no customizations, only running with apps from AppSource.

From a business perspective, Jobs are the center of how processes are organized. This is fun, because my very first project with Navision Financials 26 years ago was also job oriented.

Job Inventory

When you create a Purchase Order for an Item, Business Central allows you to populate the Job No., Job Task Code and Job Planning Line No.

If you do that, Business Central will create an Item Ledger Entry with the correct Job No. populated, but it will also create a negative correction.

Business Central seems not to support Job Inventory.

Marije, that is not correct!

If you open the Item Journal page in Business Central you can make the Job No. and the Job Task No. visible.

When you do that and put some values in these fields and post a purchase you will see that you’ll get an Item Ledger Entry with the Job No. populated WITHOUT the negative correction.

This means that Business Central as-such is capable of having Job specific inventory, just not when Purchase Documents are being used.

Let’s wake up the developer!

If you can create Job Inventory from the Item Journal, but not from the Purchase Order the business logic is probably in Codeunit 90, not in Codeunit 22.

When we use Statical Prism we can confirm that.

In Codeunit 90 there is a function called PostItemJnlLineJobConsumption which does the negative correction.

And what do we see! There is an event called OnPostItemJnlLineJobConsumption with a Handled flag.

What if we write this code

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", 'OnPostItemJnlLineJobConsumption', '', false, false)]
    local procedure SkipItemJobApplicationPurchase(var IsHandled: Boolean)
    IsHandled := true; // Just skip everything...

That’s it!

OMG! If you activate this one line of “code” you can actually have inventory on Jobs.

Can it be that simple? What’s the catch? If it were this simple, then why does Microsoft not allow Job Inventory?

There is a catch!

It works, but there is another problem… and I will discuss that tomorrow or wednesday in Part II of this post…



  1. betweendays says:

    The Negative Adjustment makes sense to me, because it assumes that you are consuming the inventory on the job and therefore don’t want it as free stock?

    Liked by 1 person

    1. I don’t disagree, but wait for part # 2…


Leave a Comment

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.