[SysODataActionAttribute('updateShipmentDate', false)]
public static void updateShipmentDate(DataAreaId _company, WHSShipmentId _ShipmentId, WHSShipConfirmUTCDateTime _ShipmentDate)
{
#OCCRetryCount;
WHSShipmentTable whsShipmentTable;
try
{
changecompany(_company)
{
select firstonly forupdate whsShipmentTable
where whsShipmentTable.ShipmentId == _ShipmentId;
if (whsShipmentTable.RecId)
{
ttsbegin;
whsShipmentTable.ShipConfirmUTCDateTime =_ShipmentDate;
if(WHSShipmentTable.validateWrite())
{
whsShipmentTable.update();
}
ttscommit;
}
}
}
catch (Exception::UpdateConflict)
{
if (appl.ttsLevel() == 0)
{
if (xSession::currentRetryCount() >= #RetryNum)
{
throw Exception::UpdateConflictNotRecovered;
}
else
{
retry;
}
}
else
{
throw Exception::UpdateConflict;
}
}
}
public static void updateShipmentDate(DataAreaId _company, WHSShipmentId _ShipmentId, WHSShipConfirmUTCDateTime _ShipmentDate)
{
#OCCRetryCount;
WHSShipmentTable whsShipmentTable;
try
{
changecompany(_company)
{
select firstonly forupdate whsShipmentTable
where whsShipmentTable.ShipmentId == _ShipmentId;
if (whsShipmentTable.RecId)
{
ttsbegin;
whsShipmentTable.ShipConfirmUTCDateTime =_ShipmentDate;
if(WHSShipmentTable.validateWrite())
{
whsShipmentTable.update();
}
ttscommit;
}
}
}
catch (Exception::UpdateConflict)
{
if (appl.ttsLevel() == 0)
{
if (xSession::currentRetryCount() >= #RetryNum)
{
throw Exception::UpdateConflictNotRecovered;
}
else
{
retry;
}
}
else
{
throw Exception::UpdateConflict;
}
}
}
No comments:
Post a Comment