...
CLEAR(ServLogMgt);
ServLogMgt.ServItemOffServOrder(Rec);
// Delete the following lines.
ServOrderMgt.UpdateResponseDateTime(Rec,TRUE);
UpdateStartFinishDateTime("Document Type","Document No.","Line No.",CALCDATE('<CY+1D-1Y>',WORKDATE),0T,0D,0T,TRUE);
// End of the lines.
ServOrderMgt.UpdatePriority(Rec,TRUE);
DimMgt.DeleteDocDim(DATABASE::"Service Item Line","Document Type","Document No.","Line No.");
END;
...
...
CLEAR(ServLogMgt);
ServLogMgt.ServItemOffServOrder(Rec);
// Add the following lines.
IF NOT CalledFromDelete THEN BEGIN
ServOrderMgt.UpdateResponseDateTime(Rec,TRUE);
UpdateStartFinishDateTime("Document Type","Document No.","Line No.",CALCDATE('<CY+1D-1Y>',WORKDATE),0T,0D,0T,TRUE);
END;
// End of the lines.
ServOrderMgt.UpdatePriority(Rec,TRUE);
DimMgt.DeleteDocDim(DATABASE::"Service Item Line","Document Type","Document No.","Line No.");
END;
...