StoreDocDim( DATABASE::"Sales Header",SalesHeader."Document Type", SalesHeader."No.",0,SalesHeader."Doc. No. Occurrence",SalesHeaderArchive."Version No.", DATABASE::"Sales Header Archive"); ............ ............ StoreDocDim( DATABASE::"Sales Line",SalesLine."Document Type",SalesLine."Document No.", SalesLine."Line No.",SalesHeader."Doc. No. Occurrence","Version No.", DATABASE::"Sales Line Archive");
StoreDocDim(TableId : Integer;DocType : Option;DocNo : Code[20];LineNo : Integer;DocNoOccurrence : Integer;VersionNo : Integer;NewTableID : Integer) DocDim.SETRANGE("Table ID",TableId); DocDim.SETRANGE("Document Type",DocType); DocDim.SETRANGE("Document No.",DocNo); DocDim.SETRANGE("Line No.",LineNo); IF DocDim.FINDSET THEN REPEAT DocDimArchive.INIT; DocDimArchive.TRANSFERFIELDS(DocDim); DocDimArchive."Table ID" := NewTableID; DocDimArchive."Version No." := VersionNo; DocDimArchive."Doc. No. Occurrence" := DocNoOccurrence; DocDimArchive.INSERT; UNTIL DocDim.NEXT = 0;
DocDimensionArchive.SETRANGE("Table ID",DATABASE::"Sales Header"); DocDimensionArchive.SETRANGE("Document Type","Document Type"); DocDimensionArchive.SETRANGE("Document No.","No."); DocDimensionArchive.SETRANGE("Doc. No. Occurrence","Doc. No. Occurrence"); DocDimensionArchive.SETRANGE("Version No.","Version No."); DocDimensionArchive.DELETEALL; DocDimensionArchive.SETRANGE("Table ID",DATABASE::"Sales Line"); DocDimensionArchive.DELETEALL;
Answers