4. Dezember 2009 13:00
setWorkTimeSplit2JobJnlLine(VAR pReWorkTimeSplitt : Record "Work time registration split";pInJobJnlLineNo : Integer)
grcJobJournalLine.RESET;
IF NOT grcJobJournalLine.FINDLAST THEN BEGIN
greJobJournalLine2.INIT;
greJobJournalLine2."Journal Template Name" := 'System';
greJobJournalLine2."Journal Batch Name" := 'Standard';
greJobJournalLine2."Line No." := 10000;
greJobJournalLine2.INSERT(TRUE);
greJobJournalLine2."Job No." := pReWorkTimeSplitt."Job No. (splitted)";
greJobJournalLine2."Posting Date" := TODAY;
greJobJournalLine2."Document Date" := pReWorkTimeSplitt."Posting Date";
greJobJournalLine2."JSP Code" := pReWorkTimeSplitt."JSP Code";
greJobJournalLine2."Unit of Measure Code" := pReWorkTimeSplitt."Unit of Measure Code";
greJobJournalLine2."Work Type Code" := pReWorkTimeSplitt."Work Type Code";
greJobJournalLine2.Quantity := pReWorkTimeSplitt."Quantity (splitted)";
greJobJournalLine2.Description := pReWorkTimeSplitt.Description;
greJobJournalLine2."External Document No." := FORMAT(pInJobJnlLineNo);
pReWorkTimeSplitt."Job Journal Line No." := pInJobJnlLineNo;
pReWorkTimeSplitt.MODIFY;
greJobJournalLine2.MODIFY(TRUE);
END ELSE BEGIN
greJobJournalLine2.INIT;
greJobJournalLine2."Journal Template Name" := 'System';
greJobJournalLine2."Journal Batch Name" := 'Standard';
greJobJournalLine2."Line No." := grcJobJournalLine."Line No." + 10000;
greJobJournalLine2.INSERT(TRUE);
greJobJournalLine2."Job No." := pReWorkTimeSplitt."Job No. (splitted)";
greJobJournalLine2."Posting Date" := TODAY;
greJobJournalLine2."Document Date" := pReWorkTimeSplitt."Posting Date";
greJobJournalLine2."JSP Code" := pReWorkTimeSplitt."JSP Code";
greJobJournalLine2."Unit of Measure Code" := pReWorkTimeSplitt."Unit of Measure Code";
greJobJournalLine2."Work Type Code" := pReWorkTimeSplitt."Work Type Code";
greJobJournalLine2.Quantity := pReWorkTimeSplitt."Quantity (splitted)";
greJobJournalLine2.Description := pReWorkTimeSplitt.Description;
greJobJournalLine2."External Document No." := FORMAT(pInJobJnlLineNo);
pReWorkTimeSplitt."Job Journal Line No." := pInJobJnlLineNo;
pReWorkTimeSplitt.MODIFY;
greJobJournalLine2.MODIFY(TRUE);
END;
IF "Approval Status Responsible" = "Approval Status Responsible"::Released THEN BEGIN
"Approval Date Responsible" := TODAY;
// -ROM20091203
grcWorkTimeRegistrationSplit.RESET;
grcWorkTimeRegistrationSplit.SETCURRENTKEY("Job Journal Line No.");
grcWorkTimeRegistrationSplit.SETFILTER("Job Journal Line No.",'>%1',0);
IF grcWorkTimeRegistrationSplit.FINDLAST THEN
gInJobJournalNo := grcWorkTimeRegistrationSplit."Job Journal Line No." + 1
ELSE
gInJobJournalNo := 1;
greWorkTImeRegSplit.RESET;
greWorkTImeRegSplit.SETRANGE("Resource No.","Resource No.");
greWorkTImeRegSplit.SETRANGE("Line No.","Line No.");
IF greWorkTImeRegSplit.FINDFIRST THEN BEGIN
REPEAT
gCuFunctions.setWorkTimeSplit2JobJnlLine(greWorkTImeRegSplit,gInJobJournalNo);
greWorkTImeRegSplit.MODIFY;
gInJobJournalNo += 1;
UNTIL greWorkTImeRegSplit.NEXT = 0;
END;
// +ROM20091203
4. Dezember 2009 13:14
4. Dezember 2009 13:21
8. Dezember 2009 16:00
9. Dezember 2009 11:48
DYNAMICS-ML hat geschrieben:Wenn ich Deine Programmlogik richtig interpretiert habe: Versuch mal den MODIFY im Code der Tabelle (nach Aufruf der Funktion) auszukommentieren. Das müsste meines Erachtens doch eigentlich reichen... den Datensatz selber hast Du ja schon in der Funktion geändert ("Job Journal Line No." eingetragen).
9. Dezember 2009 12:11
9. Dezember 2009 12:29
9. Dezember 2009 14:04