27. April 2009 10:14
27. April 2009 10:21
27. April 2009 10:25
27. April 2009 10:28
27. April 2009 10:29
27. April 2009 10:33
27. April 2009 10:33
beno hat geschrieben:Müsste ich hier jeweils etwas schliessen?
Oder was meint ihr mit temporären Records?
27. April 2009 10:35
beno hat geschrieben:Ich rufe aber in der Codeunit pro Datensatz eine Funktion innerhalb der Codeunit auf. Diese Funktion ruft dann eine andere Codeunit auf, welche... etc. etc. etc.
27. April 2009 10:36
27. April 2009 10:42
27. April 2009 10:46
27. April 2009 10:47
27. April 2009 10:48
27. April 2009 10:49
beno hat geschrieben:Wenn jemand von Euch einen kurzen Blick auf den Code werfen möchte, sagt mir einfach, wohin ich ihn schicken soll.
27. April 2009 10:56
IF recSalesInvHeaderG.FIND('-') THEN
REPEAT
OrderTypeG := recSalesInvHeaderG.FIELDNO("Order Type");
NumberG := recSalesInvHeaderG.FIELDNO("No.");
RecordRefG.GETTABLE(recSalesInvHeaderG);
recReportSelectionG.RESET;
recReportSelectionVehicleG.RESET;
CASE recSalesInvHeaderG."Order Type" OF
recSalesInvHeaderG."Order Type"::"Parts Sales & Purchases":
BEGIN
pgmDocumentPrintG.setRepSelFilter(recReportSelectionG, recReportSelectionG.Usage::"S.Inv.",
recSalesInvLineG.GetMakeForDocPrint(recSalesInvHeaderG."No.", recSalesInvHeaderG."Make Code"),
recSalesInvHeaderG."Location Code");
IF recReportSelectionG.FIND('-') THEN
REPEAT
funWindreamArchiveG(RecordRefG,OrderTypeG,NumberG,recObjectG.Type::Report,recReportSelectionG."Report ID");
UNTIL recReportSelectionG.NEXT = 0;
END;
recSalesInvHeaderG."Order Type"::"Vehicle Sales & Purchases",
recSalesInvHeaderG."Order Type"::Service:
BEGIN
IF recSalesInvHeaderG."Order Type" = recSalesInvHeaderG."Order Type"::"Vehicle Sales & Purchases" THEN
pgmDocumentPrintG.setVehicleRepSelFilter(recReportSelectionVehicleG, recReportSelectionVehicleG.Usage::"VK-RG",
recSalesInvLineG.GetMakeForDocPrint(recSalesInvHeaderG."No.", recSalesInvHeaderG."Make Code"),
recSalesInvHeaderG."Location Code")
ELSE
pgmDocumentPrintG.setVehicleRepSelFilter(recReportSelectionVehicleG, recReportSelectionVehicleG.Usage::"WS-RG",
recSalesInvLineG.GetMakeForDocPrint(recSalesInvHeaderG."No.", recSalesInvHeaderG."Make Code"),
recSalesInvHeaderG."Location Code");
IF recReportSelectionVehicleG.FIND('-') THEN
REPEAT
funWindreamArchiveG(RecordRefG,OrderTypeG,NumberG,recObjectG.Type::Report,recReportSelectionVehicleG."Report ID");
UNTIL recReportSelectionVehicleG.NEXT = 0;
END;
END;
UNTIL (recSalesInvHeaderG.NEXT = 0);
funWindreamArchiveG(RecordRefL : RecordRef;OrderTypeL : Integer;NumberL : Integer;ObjectTypeL : Integer;ReportIDL : Integer)
pgmGlobal.ÜbergabeFilter(RecordRefL.GETVIEW);
TableIDL := RecordRefL.NUMBER;
//Update Fortschrittsfenster
IF GUIALLOWED THEN BEGIN
ProgressCounterG += 1;
WindowG.UPDATE(2,ROUND(ProgressCounterG * 10000 / ProgressFactorG,1));
WindowG.UPDATE(1,FORMAT(RecordRefL.CAPTION));
IF RecordRefL.FIELDEXIST(OrderTypeL) THEN
WindowG.UPDATE(4,FORMAT(RecordRefL.FIELD(OrderTypeL)) + ' ' + FORMAT(RecordRefL.FIELD(NumberL)))
ELSE
WindowG.UPDATE(4,FORMAT(RecordRefL.FIELD(NumberL)));
CASE TableIDL OF
DATABASE::"Sales Invoice Header",
DATABASE::"Sales Credit Memo Header",
DATABASE::"Issued Reminder Header":
BEGIN
CASE TableIDL OF
DATABASE::"Sales Invoice Header":
BEGIN
ProgressCounterSalesInvG += 1;
WindowG.UPDATE(3,ROUND(ProgressCounterSalesInvG * 10000 / ProgressFactorSalesInvG,1));
END;
DATABASE::"Sales Credit Memo Header":
BEGIN
ProgressCounterSalesCredG += 1;
WindowG.UPDATE(3,ROUND(ProgressCounterSalesCredG * 10000 / ProgressFactorSalesCredG,1));
END;
DATABASE::"Issued Reminder Header":
BEGIN
ProgressCounterIssRemG += 1;
WindowG.UPDATE(3,ROUND(ProgressCounterIssRemG * 10000 / ProgressFactorIssRemG,1));
END;
END;
END;
DATABASE::"Purch. Invoice Header",
DATABASE::"Purch. Credit Memo Header":
BEGIN
CASE TableIDL OF
DATABASE::"Purch. Invoice Header":
BEGIN
ProgressCounterPurchInvG += 1;
WindowG.UPDATE(3,ROUND(ProgressCounterPurchInvG * 10000 / ProgressFactorPurchInvG,1));
END;
DATABASE::"Purch. Credit Memo Header":
BEGIN
ProgressCounterPurchCredG += 1;
WindowG.UPDATE(3,ROUND(ProgressCounterPurchCredG * 10000 / ProgressFactorPurchCredG,1));
END;
END;
END;
DATABASE::"Vendor Ledger Entry":
BEGIN
ProgressCounterVendLedgEntryG += 1;
WindowG.UPDATE(3,ROUND(ProgressCounterVendLedgEntryG * 10000 / ProgressFactorVendLedgEntryG,1));
END;
END;
END;
recObjectL.Type := ObjectTypeL;
EVALUATE(ObjectTypeTextL,FORMAT(recObjectL.Type));
CASE ObjectTypeL OF
recObjectL.Type::Report: IF NOT pgmWD.HasParameterEntry(ObjectTypeTextL + FORMAT(ReportIDL),1,0) THEN EXIT;
recObjectL.Type::Table: IF NOT pgmWD.HasParameterEntry(ObjectTypeTextL + FORMAT(TableIDL),1,0) THEN EXIT;
ELSE EXIT;
END;
//Archivieren
CASE TableIDL OF
DATABASE::"Sales Invoice Header",
DATABASE::"Sales Credit Memo Header",
DATABASE::"Issued Reminder Header":
pgmWD.DruckeReportArchivAusgang(TableIDL,0,FORMAT(RecordRefL.FIELD(NumberL)),
ReportIDL,pgmWD.GetDocTypeParameterEntry(ObjectTypeTextL + FORMAT(ReportIDL),1,0));
DATABASE::"Purch. Invoice Header",
DATABASE::"Purch. Credit Memo Header":
pgmWD.DruckeReportArchivEingang(TableIDL,0,FORMAT(RecordRefL.FIELD(NumberL)),
ReportIDL,pgmWD.GetDocTypeParameterEntry(ObjectTypeTextL + FORMAT(ReportIDL),1,0));
DATABASE::"Vendor Ledger Entry":
BEGIN
RecordID2L := RecordRefL.RECORDID;
IF NOT RecordRef2L.GET(RecordID2L) THEN EXIT;
FilePathL := pgmWD.SetTargetDirectory(pgmWD.GetDocTypeParameterEntry('Table ' + FORMAT(TableIDL),1,0),varArrL);
IF NOT (FILE.EXISTS(FilePathL + FORMAT(RecordRef2L.FIELD(5045182)))) THEN EXIT;
pgmWD.DruckeReportArchivEingang(TableIDL,0,FORMAT(RecordRefL.FIELD(NumberL)),
ReportIDL,pgmWD.GetDocTypeParameterEntry(ObjectTypeTextL + FORMAT(TableIDL),1,0));
END;
END;
SLEEP(1000); // Eine Sekunde warten, da die PDF-Erstellung nur im Sekundentakt erfolgen kann!
RecordID2L := RecordRefL.RECORDID;
IF RecordRef2L.GET(RecordID2L) THEN BEGIN
FieldRef2L := RecordRef2L.FIELD(5045180);
FieldRef2L.VALUE := TRUE;
RecordRef2L.MODIFY;
FieldRef2L := RecordRef2L.FIELD(5045181);
FieldRef2L.VALUE := CREATEDATETIME(TODAY,TIME);
RecordRef2L.MODIFY;
END;
COMMIT;
SLEEP(2000);
27. April 2009 11:30
DATABASE::"Sales Invoice Header":
BEGIN
CLEAR(SalesInvHeader);
SalesInvHeader.SETRANGE("No.","No.");
SalesInvHeader.FIND('-');
RecRef.OPEN(112);
RecRef.GETTABLE(SalesInvHeader);
SetWDParameterforAction('Report '+FORMAT(ReportID),5,RecRef.RECORDID,0,'',FALSE);
Archivieren(Profilname,dynvarArr);
REPORT.RUNMODAL(ReportID,FALSE,FALSE,SalesInvHeader);
END;
27. April 2009 11:30
27. April 2009 11:53
27. April 2009 11:54
27. April 2009 12:05
27. April 2009 17:05
27. April 2009 17:21