Customer shipment Entry BPM to stop over shipping

Anyone ever put a stop in place to not allow over shipping?

i have a shipping team that is making errors shipping from inventory when they should be shipping from the job. and vice versa or both. double shipping because they think there should be a quantity in the Inv ship field.
i was thinking it could put a stop if the shipping quantity was greater than the demand.

anyone ever done anything like that?

A BPM will do this for you.

var ShipDtl = ttShipDtl.Where(sd => (sd.Added()) && ((sd.OurJobShipQty + sd.OurInventoryShipQty) > (sd.SellingReqQty - sd.SellingShippedQty))).FirstOrDefault();

if(ShipDtl != null)
{

			var message = "You are attempting to overship this line. Please correct before you can continue.";
					message = message + ShipDtl.SellingReqQty + " " + ShipDtl.SellingShippedQty + " " + ShipDtl.OurJobShipQty + " " + ShipDtl.OurInventoryShipQty; 
						throw new Ice.Common.BusinessObjectException(
						new Ice.Common.BusinessObjectMessage(message)
						{
						Type = Ice.Common.BusinessObjectMessageType.Error,
						});
}

im multi tennent so i cant use code to do bpms i will have to do it in the designer.

would this be a method or data directive?

Depends at what step you’re stopping the shipment

when they click the ship button

i have this as a method.

You should be able to do everything with widgets.

what condition should i use?

image

I would personally recommend this be a pre processing method directive.

I am not sure this works in SaaS.

Create a variable.

Use the Set Argument/Variable to evaluate the condition to the variable.

Then use the Condition widget to check the variable

If yes, raise exception.

The question would be how you define “overshipping”… but assuming you’re simply shipping a single line-single release –

I would probably use the “specified field of the changed row….” And compare the shipment quantity (“our ship qty” or “our job ship qty”) to the requested qty (in the expression). If you need to check it back against the original order/line/release there may be some additional things you need to setup and it may get a bit more complicated.

I used:
anyone see any errors in this approach?

Along the lines of what ken is mentioning here - you should be able to do this in SaaS by using the query condition

I would still add the checks for the ShipQty incase there have been partial shipments.
Your Expression will be something like: if you don’t do partials your code looks good to me.
(ttShipDtlRow.SellingReqQty -(ttShipDtlRow.OurJobShipQty + ttShipDtlRow.OurInventoryShipQty)

thank you for the help.

we rarely do partial shipments. i mainly wanted to prevent them from shipping from the job quantity with mass shipment ship all. then they see that the Inv quantity is 0 they were adding 1 to this field thinking it was always supposed to ship from inventory too.