Размер видео: 1280 X 720853 X 480640 X 360
Показать панель управления
Автовоспроизведение
Автоповтор
PTE artifacts from pipeline should just be deployed to the tenant once it has been build.
Is Thursday Sales Invoice Import Challenge need to be non-coding? or small AL file for tiny PTE would work too?
if code is ok, then here it is: no foolproof, simple import based on the designpageextension 50000 "CSV Sales Invoice List" extends "Sales Invoice List"{ actions { addlast(processing) { action("CSV ImportFromCSV") { ApplicationArea = All; Caption = 'Import From CSV'; Image = Import; ToolTip = 'Import Sales Invoice'; trigger OnAction() var SH: Record "Sales Header"; SL: Record "Sales Line"; CSVB: Record "CSV Buffer"; InS: InStream; i, LineNo: Integer; DateVal: Date; DecVal: Decimal; begin if not UploadIntoStream('Select CSV File', InS) then exit; CSVB.LoadDataFromStream(InS, ','); for i := 2 to CSVB.GetNumberOfLines() do begin // Skip header if CSVB.GetValue(i, 2) SH."External Document No." then begin SH.Init(); SH.Validate("Document Type", SH."Document Type"::Invoice); SH.Insert(true); SH.Validate("Sell-to Customer No.", CSVB.GetValue(i, 1)); // Customer SH.Validate("External Document No.", CSVB.GetValue(i, 2)); // InvoiceNo Evaluate(DateVal, CSVB.GetValue(i, 3)); // Date SH.Validate("Document Date", DateVal); SH.Modify(true); LineNo := 0; end; LineNo += 10000; SL.Init(); SL.Validate("Document Type", SH."Document Type"); SL.Validate("Document No.", SH."No."); SL.Validate("Line No.", LineNo); SL.Insert(true); SL.Validate(Type, SL.Type::Item); SL.Validate("No.", CSVB.GetValue(i, 4)); // Item Evaluate(DecVal, CSVB.GetValue(i, 5)); // Qty SL.Validate("Quantity", DecVal); Evaluate(DecVal, CSVB.GetValue(i, 6)); // Unit Price SL.Validate("Unit Price", DecVal); SL.Modify(true); end; end; } } addlast(Category_Process) { actionref("CSV ImportFromCSV_Promoted"; "CSV ImportFromCSV") { } } } }
If there is a simple PTE solution, that might work. On Twitter, Shannon noted that she typically develops an XMLPort for simple integrations.
PTE artifacts from pipeline should just be deployed to the tenant once it has been build.
Is Thursday Sales Invoice Import Challenge need to be non-coding? or small AL file for tiny PTE would work too?
if code is ok, then here it is: no foolproof, simple import based on the design
pageextension 50000 "CSV Sales Invoice List" extends "Sales Invoice List"
{ actions { addlast(processing) { action("CSV ImportFromCSV") {
ApplicationArea = All;
Caption = 'Import From CSV';
Image = Import;
ToolTip = 'Import Sales Invoice';
trigger OnAction()
var
SH: Record "Sales Header";
SL: Record "Sales Line";
CSVB: Record "CSV Buffer";
InS: InStream;
i, LineNo: Integer;
DateVal: Date;
DecVal: Decimal;
begin
if not UploadIntoStream('Select CSV File', InS) then exit;
CSVB.LoadDataFromStream(InS, ',');
for i := 2 to CSVB.GetNumberOfLines() do begin // Skip header
if CSVB.GetValue(i, 2) SH."External Document No." then begin
SH.Init();
SH.Validate("Document Type", SH."Document Type"::Invoice);
SH.Insert(true);
SH.Validate("Sell-to Customer No.", CSVB.GetValue(i, 1)); // Customer
SH.Validate("External Document No.", CSVB.GetValue(i, 2)); // InvoiceNo
Evaluate(DateVal, CSVB.GetValue(i, 3)); // Date
SH.Validate("Document Date", DateVal);
SH.Modify(true);
LineNo := 0;
end;
LineNo += 10000;
SL.Init();
SL.Validate("Document Type", SH."Document Type");
SL.Validate("Document No.", SH."No.");
SL.Validate("Line No.", LineNo);
SL.Insert(true);
SL.Validate(Type, SL.Type::Item);
SL.Validate("No.", CSVB.GetValue(i, 4)); // Item
Evaluate(DecVal, CSVB.GetValue(i, 5)); // Qty
SL.Validate("Quantity", DecVal);
Evaluate(DecVal, CSVB.GetValue(i, 6)); // Unit Price
SL.Validate("Unit Price", DecVal);
SL.Modify(true);
end;
end; } } addlast(Category_Process) { actionref("CSV ImportFromCSV_Promoted"; "CSV ImportFromCSV") { } } } }
If there is a simple PTE solution, that might work. On Twitter, Shannon noted that she typically develops an XMLPort for simple integrations.