script on SO Invoice Qty shipped after "Ship Complete"

running Sage 2018 sp3.

I have this script running on quantity shipped in SO Invoice Data Entry.

tmpQtyShip=0
tmpGrWt=0

retVal = oBusObj.GetValue("QuantityShiped", tmpQtyShip)

retVal = oBusObj.GetValue("UDF_GROSS_WEIGHT", tmpGrWt)

retVal = oBusObj.SetValue("UDF_EXT_GRWT",tmpQtyShip*tmpGrWt)

It works great unless you select the prompt to "ship complete" when moving to the Lines tab in Invoice Data Entry.

Then nothing calculates.?

How do I set this to calculate after the quantity has been populated by "ship complete"?

Thanks in Advance