The wmsShipment method on the wmsPallet table, is failing to return the related Shipment.
There are multiple routes to navigate from a wmsPallet record to the wmsShipment. The standard code is joining via the InventDimId field. However for our ERP this is storing the Warehouse location of the required stock, not the target shipment. Once the ToInventDimId field is populated this contains the Target location and the outbound dock for shipping, thus joins on the wmsShipment.
Firstly is this a bug? (or a quirk for a specific style of implementation)
Secondly what are the implications of changing this use the wmsOrderTrans.ToInventDimID.
[wmsPallet table]
public WMSShipment wmsShipment(boolean _forUpdate = false)
{
WMSOrderTrans wmsOrderTrans;
InventDim inventDim;
select firstonly TableId from inventDim
index hint PalletIdIdx
where inventDim.wmsPalletId == this.wmsPalletId
join ShipmentId from wmsOrderTrans
index hint dimIdx
where wmsOrderTrans.InventDimId == inventDim.InventDimId &&
wmsOrderTrans.ExpeditionStatus != WMSExpeditionStatus::Cancelled &&
wmsOrderTrans.ShipmentId != '';
return WMSShipment::find(wmsOrderTrans.ShipmentId ,_forUpdate);
}