BPM UD OrderRel - CustShip.UpdateMaster

Hi,

We are given the task to restrict packing slip if certain documents is not being sent . C of C or FAI , the problem is these documents are sent out through email or shipment . We came up with a solution through BPM (If we can get it to work) . These FAI documents are per Customer PO , so we decided to use the UD: Example OrderRel.Checkbox10 labeled “FAI Required” in the Release tab is checked if the Customer requires the FAI Documents (Sales). Than creating an updatable dashboard for the QA to check the ShipHead.CheckBox10 if documents received (QA) . Thus allowing the packing slip (Shipping).

For Customer which Requires Documents

  1. OrderRel.Checkbox10 = Checked (FAI Required)
  2. ShipHead.CheckBox10 = Checked (Documents Sent)
  3. ttShipHead.ReadyToInvoice = False to True = Shipped
    If 1 is checked and 2 is not , raise exception when Shipped.

For Customer which do NOT Requires Documents

  1. OrderRel.Checkbox10 = NOT Checked
    Bypass all conditions and ship as usual

Updatable dashboard

Configured as below:
CustShip.UpdateMaster
Conditions:

number of rows in the ‘FAI’ query is less than 1
and the ShipHead.CheckBox10 field of the changed row is equal to the false expression
and the ttShipHead.ReadyToInvoice field has been changed from False to True

Action:

raise exception based on the FAI template

FAI Query
for each ShipHead no-lock , each ShipDtl no-lock where ShipHead.Company = ShipDtl.Company and ShipHead.PackNum = ShipDtl.PackNum , each OrderRel no-lock where ShipDtl.Company = OrderRel.Company and ShipDtl.OrderNum = OrderRel.OrderNum and ShipDtl.OrderLine = OrderRel.OrderLine and ShipDtl.OrderRelNum = OrderRel.OrderRelNum and OrderRel.CheckBox10 = yes

The issue above is no matter if the OrderRel.CheckBox10 is checked or unchecked we are still getting the exception window.
image
Any help will be greatly appreciated . Thank you

So you want to allow packers to be entered, but not marked as shipped unless docs were sent? (On orders requiring them)

Hi @ckrusen . Packing can be created as normal but when the above conditions not met for FAI Required . Exception triggers when ttShipHead.ReadyToInvoice (Shipped) False To True

Should that be ttShipHead.CheckBox10, instead of just ShipHead.Checkbox10?

And is this a pre-process or post-process BPM?

@ckrusen

Its ttShipHead . Just when in display is shows ShipHead

Yes its in Pre-Processing

Try the 3 conditions, one at a time.

Just,
“number of rows in the ‘FAI’ query is less than 1”

Then just
“the ShipHead.CheckBox10 field of the changed row is equal to the false
expression”

Then just
“the ttShipHead.ReadyToInvoice field has been changed from False to True”

To make sure each condition is met as expected.

If each works as expected, try just 2 of them …

Also, have you run a trace to make sure the update happens just once?

I recall that marking a packer as shipped causes something to happen before you even save the packer. Maybe all the conditions you’re looking for arent happenong at tge same time.

I do this kind of check in the DD on ShipHead in code. I had a couple close, so I took them and made the condition you need. I am with Calvin that there is a lot behind the scenes happening and MasterUpdate might not work for this.

Greg

image

/* alert on FAI docs not sent */

For first ttShipHead no-lock  , 
	Each ShipDtl no-lock  where ttShipHead.Company = ShipDtl.Company and ttShipHead.PackNum = ShipDtl.PackNum.

	Find first OrderRel where ShipDtl.Company = OrderRel.Company and 
		ShipDtl.OrderNum = OrderRel.OrderNum and ShipDtl.OrderLine = OrderRel.OrderLine and 
		ShipDtl.OrderRelNum = OrderRel.OrderRelNum  no-lock no-error.
		
			If available ( OrderRel ) Then Do:


					If OrderRel.CheckBox10 = true and ttShiphead.CheckBox10 = false Then Do: 
		 
				  def var Msg as character init ''.
					Msg = "Docs not sent yet".
	
					{lib/PublishEx.i &ExMsg = Msg &ExType = {&MESSAGE_ERR}}.
		 		End.
		 
		 End.
End.		 

@gpayne
Works like a charm . Thank you

@ckrusen
Thank you for your time and effort