Job Traveler BPM with OnHand Quantity


(Edward Yeend) #1

Hi there,

I’m trying to create a BPM where it would bring up a message with the On Hand Quantity after the Job is released/Job Traveler is produced, and would stop Jobs becoming firm/released if the production/required quantity is greater than the On Hand Quantity.

I have a feeling that it would need to be done in the Method Directives Pre-Processing BPM in the Part.Update section.

However, I haven’t created many BPMs before and I’m unsure to what conditions/actions would be needed.

Any help on this topic would be appreciated.
Thanks


(Tyler Leonard) #2

Since you want to prevent the job from being released, I’d run the BPM on a method that gets run only when the job is released. Probably something in the JobEntry biz object, you can figure out what it’s called by using Tracing Options.

You may be able to do a query condition to see if prod qty > on hand qty. Action would be to raise an exception. This will prevent the method from finishing, so job won’t be released, and display a message box that you define. If the query isn’t possible then you’d need to do custom code, which would give you same result if written properly.

You could do a similar BPM on a method that runs when jobs are firmed. Alternatively:
-if all your jobs are made via MRP, and therefore they all need to be firmed before being released, you’d only need the BPM on the firming method.
-i think you could do a data directive on JobHead that runs if the released or firm fields are changed from false to true. this would actually be easier as you could kill 2 birds with 1 stone, only would need the 1 data directive instead of 2 method directives.

This is an overview, I can provide more info on any of this if needed.


(Edward Yeend) #3

Hi Tyler,

Thanks for the overview; it’s been very helpful.

Of what I can gather from your reply, it should be a Method Directive BPM, and it should run on a JobEntry object? I’ll have a look into the Tracing Options to see which object I should use, but of the top of me head, does the Update object seem about right to you?

I was thinking of using the Condition of if the Prod Qty > On Hand Qty, then use the Raise Exception action to bring up a text box or message that would be something like ‘Not enough parts for the job’. Do you know what the Custom Code would look like, in terms of what Business Objects used?

I was also thinking of creating another BPM that would see if the job was firmed. However, I do believe that the jobs are created via MRP every night. So do you think that using a Data Directive on the JobHead table would be easier?


(Tyler Leonard) #4

Yea I would try an in-transaction data directive on JobHead. For the Prod Qty > On Hand Qty condition, you’ll need to do a query condition as the fields are in different tables.

As long as the query condition works, you won’t need custom code. You can manually add tables to the query condition, like in a BAQ. For the stop exception, there is a standard action for a stop condition called “raise exception based on the designed template”. Don’t forget to also have conditions where either the released or firmed fields must have been changed from false to true.

Try that, lemme know if any of it doesn’t make sense or you get stuck.


(Edward Yeend) #5

Hi Tyler,

I’m in the process of creating this BPM and I’ve done the ‘Actions’ section where it’s ‘Raise exception based on the designed template’.

However (as I’ve not made many BPMs before), which condition do you think would suit this scenario best?

Thanks.


(Tyler Leonard) #6

Use the “number of rows in the designed query is not less than 1” condition. In there, you can design a query similar to how you’d design a BAQ, or you can write the code by hand. If you leave it as “is not less than 1”, the condition will pass only when 1 or more query results is returned. When the condition passes, your action, the stop exception, runs.

I think I misunderstood what you were trying to do earlier. Are you trying to identify whether the job has 1 or more JobMtls that have required qty > on hand qty?

If it’d be easier you to do this over phone, you can reach me @ 507-331-4356. You can always post solution and mark thread as solved once we’ve discussed and you’ve implemented the solution. If you want to do that and you have TeamViewer that would be helpful, as I’d be able to see your screen and instruct you.


(Edward Yeend) #7

What I’m trying to do is bring up or stop the job being released or firmed.
Ideally (if possible) is to do a query where the Required Qty or Production Qty is greater than the On Hand Qty, to bring up the Stop action.


(Tyler Leonard) #8

Yea I understand you’re trying to prevent the job from being released or firmed. But Required Qty and Prod Qty are 2 very different fields on different tables. Prod Qty is on JobHead table, refers to the total qty of the main part that you’re producing in the job. Required qty is on JobMtl, refers to the amount of a job material that is needed in the job.

I’m guessing you want to prevent the job from being released or firmed if 1 or more of its materials has more required qty than on hand qty. This would mean that you’d first need to produce more of this material before completing the job that it’s in. I don’t know why you’d want to prevent the part itself from being produced if there was less of it on hand than what you’re trying to produce in the job. I’m trying to understand what you’re doing because it will affect the query code that you want on your condition.

If you haven’t done so already, you can at least add your conditions that identify whether the job was firmed or released. I made the firmed one so you can copy and do the same for the released field (see image below). These identify whether someone has attempted to firm or release the job, so that you’re stop exception only runs when someone does this.

I’d recommend reading Epicor’s documentation on BPMs so you have a better idea of what’s going on. It’s in the ICE tools, chapters 11-12.


(Edward Yeend) #9

I understand that they’re in two separate tables.

Ideally, we don’t want the job to be released or firmed if 1 or more of the materials that are required if it’s higher than the on hand quantity for that material (part).

So if the job has a production qty of 5 & requires a material that has a qty to parent ratio of 2 so we’d need a qty of 10. If the on hand qty of that material is 9, the job couldn’t/wouldn’t be firmed and/or released.

If that makes sense.


(Tyler Leonard) #10

Yea that makes sense. JobMtl.RequiredQty = JobMtl.QtyPer * JobHead.ProdQty, so you won’t need to worry about the prod qty, just the required qty. As long as each part is only stored in 1 warehouse, you can compare this qty to PartWhse.OnHandQty with a criteria on PartWhse or JobMtl in your query condition. If JobMtl.RequiredQty > PartWhse.OnHandQty, then return the record in the query. If 1 or more records is returned in the query then the query action passes, so stop exception can run.


(Edward Yeend) #11

Hi Tyler,

Thanks for the help :slight_smile: it seems to work to a point as I’ve done it in both the JobHead and JobMtl tables (with only one Enabled at a time). However, when I go and create a new job, Epicor seems to stop working (Not Responding) after I enter a Demand Link and save.

Do you know why this would be?


(Tyler Leonard) #12

Nah I’m not sure. The JobMtl directive is gonna be run indirectly a bunch of times when you update a demand link as doing so will change the required qty of each JobMtl. If the condition evaluates to true then it should prevent you from saving the demand link. I’d expect to see your stop exception message pop up though, not Epicor to freeze. Why do you need a directive on JobMtl and how are you making sure that released or firm was changed from false to true in order for conditions to pass?

Not sure why the JobHead one would have that issue. Maybe someone else from the community will know.


(Edward Yeend) #13

It is quite a strange one. I’ll have a further look into it to see if I can find anything and will keep you updated in-case something like this happens for someone else.

On closer look, I’m thinking of using the JobHead table as I’ve noticed now that I can’t change the Job Firm or Release from false to true on that table.