...
VALIDATE(Status,Status::Open);
TESTFIELD("Time Activity Code");
GetCalendar;
IF (Calendar."Shift Days" = 0) AND (NOT Nonworking) THEN
TESTFIELD("Work Hours");
Status := Status::Released;
MODIFY;
...
...
VALIDATE(Status,Status::Open);
TESTFIELD("Time Activity Code");
GetCalendar;
IF (Calendar."Shift Days" = 0) AND (NOT Nonworking) THEN
TESTFIELD("Work Hours");
// Add the following lines.
Employee.RESET;
IF Employee.FINDSET THEN
REPEAT
IF Employee.GetJobEntry(Employee."No.",Date,EmplJobEntry) THEN
IF (EmplJobEntry."Calendar Code" = "Calendar Code") AND
TimesheetStatus.GET(PayrollPeriod.PeriodByDate(Date),Employee."No.")
THEN BEGIN
TimesheetStatus.TESTFIELD(Status,TimesheetStatus.Status::Open);
TimesheetMgmt.UpdateTimesheet(Employee,Date,Date,"Calendar Code",FALSE);
END;
UNTIL Employee.NEXT = 0;
// End of the added lines.
Status := Status::Released;
MODIFY;
...