[ExtensionOf(tableStr(WorkflowTrackingTable))]
final class UTT_WorkflowTrackingTable_T_Extension
{
public static void saveTracking(SysWorkflowTracking _tracking)
{
next saveTracking(_tracking);
ttsbegin;
//Updating PurchTable.UTTRejectionReason once the user rejects the workflow
//I used .doUpdate() to bypass standard validation - Changes in PO are only allowed in Draft when change management is activated
if(_tracking.parmTrackingType() == WorkflowTrackingType::Rejection &&
_tracking.parmContextTableId() == tableNum(PurchTable))
{
PurchTable purchTable = PurchTable::findRecId(_tracking.parmContextRecId(), true);
purchTable.UTTRejectionReason = _tracking.parmTrackingComment();
purchTable.doUpdate();
}
ttscommit;
}
}
No comments:
Post a Comment