BPM to prevent shipping part on quality hold

Hello,

I’m tasked with created a way to prevent shipment of a part that an engineer/QC has placed on hold. I added a checkbox to the part master and if checked, I want a warning to alert the shipping dept so that they first check with quality prior to shipping the order.

I ran a trace and it looks like GetOrderRelInfo on the CustShip BO is the first place the partnum shows up. My idea was to create a pre-processing directive with the condition being this query:

As you guessed, it’s not working…I’ve tried a few different methods (update, update master) but no deal. I’m assuming it’s the query and that it’s not as simple as just joining part with ttShipDtl to check for the custom flag…but at this point I’m guessing.

If I’m close and it’s a simple fix, I’m all ears, if it’s much more involved than that and requires coding then I’ll have to find a different solution.

Thanks for reading.

@rirish That looks like it should work. I took a routine that warned shipping and modified it to check for this that should work on UpdateMaster. I do not have a e9 install running to check this, but if you paste the code in it should work.

/* check Part on hold */

DEFINE VARIABLE xMsg AS CHARACTER.


For each ttShipDtl where ttShipDtl.RowMod="U" or ttShipDtl.RowMod="A":
	
		For First Part fields ( CheckBox04 ) where ttShipDtl.PartNum = Part.PartNum and ttShipDtl.Company = cur-comp and Part.CheckBox04 = True.
		
				If Part.CheckBox04 = True then DO:
					ASSIGN xMsg = "Part: " + ttShipDtl.PartNum + " is on Hold " + "~nContact Quality for approval to ship".
				
					/* {lib/PublishEx.i &ExMsg = "xMsg"} */ /* stop */
					
									
					{lib/PublishEx.i &ExMsg = xMsg &ExType = {&MESSAGE_ERR}}. /* warn */
				END.
				
		End.
		
END.
1 Like

And… once you get to Epicor 10, you will need to rebuild this code (one of my hobbies)…
it becomes a lot more efficient and smaller (three whole lines of code… inserted returns to make it easier to read).

var ttSDtl = ttShipDtl.Where(x => x.RowMod != "");
bool partOnHold = Db.Part.Any(x =>
    x.Company == ttSDtl.Company &&
    x.PartNum == ttSDtl.PartNum &&
    x.CheckBox04 == true);
if (partOnHold) {
    throw new Ice.BLException($"Part: {ttSDtl.PartNum} is on hold\nContact Quality for approval to ship");
}
1 Like

Thanks, gentlemen. Sorry to disappoint, but I don’t know what to do with code even when it’s so kindly gift wrapped and presented. I’m a hack who depends on the GUI for everything. I’ll keep working on the BPM angle, Greg gave me some hope by suggesting that I’m close!

Edit: I think I have it sorted out. Thanks again.

1 Like