X++:
public void run()
{
WMSOrderTrans WMSOrderTransCopy;
setPrefix(WMSOrderTransSplit::description());
try
{
ttsbegin;
if (!this.validate())
throw error("@SYS18447");
select firstonly forupdate WMSOrderTransCopy
index hint OrderIdx
where WMSOrderTransCopy.orderId == WMSOrderTrans.orderId &&
WMSOrderTransCopy.itemId == WMSOrderTrans.itemId &&
WMSOrderTransCopy.recId == WMSOrderTrans.recId;
if (!WMSOrderTransCopy || !bufCmp(WMSOrderTransCopy, WMSOrderTrans))
throw error("@SYS18447");
WMSOrderTrans.split(splitQty);
ttscommit;
}
catch (Exception::Deadlock)
{
retry;
}
}