SubJobsT.SETFILTER(SubJobsT."Master Job No.", JobsT."No."); IF SubJobsT.FINDSET THEN BEGIN REPEAT IF SubJobsT."Job Type" = Job."Job Type"::Resource THEN BEGIN // do stuff END ELSE BEGIN count := count + 1; NewJobNo := JobNoFormat(ResourceJobNo, count); NewJobNo := JobNoValidation(SubJobsT, NewJobNo); SubJobsT.LOCKTABLE; SubJobsT."Parent Job No." := parentJobNo; SubJobsT.MODIFY; SubJobsT.RENAME(NewJobNo); END; UNTIL SubJobsT.NEXT = 0; END; count := 0;
if SubJobsT.findset then Repeat Subjobs2.init; Subjobs2 := SubJobsT; Subjobs2.rename(NewJobNo); until SubJobsT.next = 0;
Answers
then checked to make sure the record's isclean field was false before continuing.