The Job Inventory Problem | Part II

Let’s continue where we left off in my previous post about Job Inventory.

In that post, I’ve tried to explain that when you purchase something for a specific Job in Microsoft Dynamics 365 Business Central the inventory is always corrected to zero unless you post your transaction via the Item Journal.

In the last few major releases Microsoft made a lot of improvements to the integration with the Job Module and the rest of Business Central.

Let’s review two of these improvements and then explain the “problem” that these improvements have created and (spoiler alert) how to fix this problem.

Improvement I – Order Planning

Microsoft has integrated the Order Planning module with Jobs. That means that if you need an item for a project you can create purchase orders automatically without having to type the data again.

Problems with this improvement

  • You cannot filter on a specific Job. The software will calculate demand for all Jobs. In many cases someone at procurement is assigned to be responsible for one or more jobs, but not for all jobs.
  • In the Purchase Order the Job No. field is populated, this means that you cannot put the item on inventory

It might have been better if Microsoft had created a reservation for a Job instead of populating the Job No.

Improvement II – Integration with Reservations

From a Job Planning Line, if you need an Item you can make a reservation.

This makes sure nobody else takes away this item from inventory.

Improvement III – WMS Integration

In the Warehouse Setup, a new Bin is added for Jobs.

This allows you to move free inventory to a specific Job. It is not exactly the same as a reservation but it is another way to indicate you want to use an item for a specific Job.

So Marije, what is the problem?

You may think, wow! How cool are all these improvements? And yes, they are… but they don’t seem to work together.

The problem is, that is you run Order Planning for a Job, the Job No. field in the Purchase Line is populated.

This field prevents us to use the WMS system. If you purchase an item for a Job you CANNOT create a Warehouse Receipt!

This is strange, because if I purchase a Diesel Engine for a ship it comes into my warehouse on a pallet and until I really need the engine I need to store it somewhere. Then, when I actually need the engine I want to pick it from the warehouse and bring the engine to the place where it needs to be. Then I will also create a Job Journal Line and consume the Item for the Job.

I do not want anyone else in my company to use the engine for another job. I need the engine to be reserved, exclusively for my Job.

However, let’s say I need an engine for another ship, and I need it tomorrow and the reordering time for an engine is 10 days and I don’t need it on my ship for another 2 weeks I want to be able to change the reservation and order a new engine and switch stuff around.

So how do we fix this Marije?

The good news is that this again is an easy fix! You can fix this by changing two simple filters with an event subscriber,

Let’s bring in the Developer!

There are two processes we need to change

  1. Warehouse – Get Source Documents
  2. Warehouse – Purchase Release

Both processes simply contain a hard filter on the Job. No. field in the Purchase Line. They require the field to be empty.

I checked on Mibuso.com and this behaviour has been the standard behavior as long as the modules have been around, and all these years folks have been removing this filter to fix it.

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Whse.-Purch. Release", 'OnAfterReleaseSetFilters', '', false, false)]
local procedure IgnoreJobFilterRelease(var PurchaseLine: Record "Purchase Line")
begin
    PurchaseLine.SetRange("Job No.");
end;

[EventSubscriber(ObjectType::Report, Report::"Get Source Documents", 'OnAfterPurchaseLineOnPreDataItem', '', false, false)]
local procedure IgnoreJobFilterGetSourceDocuments(var PurchaseLine: Record "Purchase Line")
begin
    PurchaseLine.SetRange("Job No.");
end;

So what is the catch?

With this change, and the change in my previous blog you can purchase items for a specific Job and receive it in your warehouse. This allows you to keep track of the location/zone/bin of the item and keep it on stock until you need it.

Unless you make the reservation you do not actually prevent others from using your item. Without the reservation it’s just a gentlements- (or ladies-) agreement that you don’t steal each others items.

In most organizations that work with Jobs this is not a problem. People don’t go around and steal each others items from the warehouse and in most cases the warehouse people are trained to distinguish between Job specific items and free inventory.

Is there an App for this?

So with these events, which obviously someone has requested, there must be an App for this on AppSource right?

And there is.

The App we found is created by To-Increase and it allows you to purchase items for a Job and keep it in inventory and warehouse until you need it.

This this a Bug/Gap in Business Central?

What is your opinion? Should this option be added to Business Central out-of-the-box? And if so, what else could I have missed?

Advertisement

3 Comments

  1. Ahmed says:

    Great blog. They could make it a setup as well, to enable it.

    Like

  2. GrumpyNAVdev says:

    Great article – however I would like to hear if you ended up staying true to the goal of only using AppSource apps and bought the app, or if you made a tiny PTE to solve this issue?

    Liked by 1 person

    1. I will keep you posted. There are a few options right now and there is a meeting next week to determine in which direction we are heading. Thanks for reading my blog!

      Liked by 1 person

Leave a Comment

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

WordPress.com Logo

You are commenting using your WordPress.com 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.