Why do you need this change?
Required to allow custom import processing for Data Exchange before standard Codeunit/XMLport import execution.
Describe the request
Current Code
procedure ImportToDataExch(DataExchDef: Record "Data Exch. Def"): Boolean
var
Source: InStream;
ProgressWindow: Dialog;
begin
if not "File Content".HasValue() then
if not ImportFileContent(DataExchDef) then
exit(false);
ProgressWindow.Open(ProgressWindowMsg);
"File Content".CreateInStream(Source);
SetRange("Entry No.", "Entry No.");
if DataExchDef."Reading/Writing Codeunit" > 0 then
CODEUNIT.Run(DataExchDef."Reading/Writing Codeunit", Rec)
else begin
DataExchDef.TestField("Reading/Writing XMLport");
XMLPORT.Import(DataExchDef."Reading/Writing XMLport", Source, Rec);
end;
ProgressWindow.Close();
exit(true);
end;
Requested Change
procedure ImportToDataExch(DataExchDef: Record "Data Exch. Def"): Boolean
var
Source: InStream;
ProgressWindow: Dialog;
IsHandled: Boolean;
begin
if not "File Content".HasValue() then
if not ImportFileContent(DataExchDef) then
exit(false);
**IsHandled := false;
OnBeforeImportToDataExch(Rec, DataExchDef, IsHandled);
if not IsHandled then begin
ProgressWindow.Open(ProgressWindowMsg);**
"File Content".CreateInStream(Source);
SetRange("Entry No.", "Entry No.");
if DataExchDef."Reading/Writing Codeunit" > 0 then
CODEUNIT.Run(DataExchDef."Reading/Writing Codeunit", Rec)
else begin
DataExchDef.TestField("Reading/Writing XMLport");
XMLPORT.Import(DataExchDef."Reading/Writing XMLport", Source, Rec);
end;
ProgressWindow.Close();
end;
exit(true);
end;
Requested Event Publisher
[IntegrationEvent(false, false)]
local procedure (var DataExch: Record "Data Exch."; var DataExchDef: Record "Data Exch. Def"; var IsHandled: Boolean)
begin
end;
Why do you need this change?
Required to allow custom import processing for Data Exchange before standard Codeunit/XMLport import execution.
Describe the request
Current Code
procedure ImportToDataExch(DataExchDef: Record "Data Exch. Def"): Boolean
var
Source: InStream;
ProgressWindow: Dialog;
begin
if not "File Content".HasValue() then
if not ImportFileContent(DataExchDef) then
exit(false);
Requested Change
procedure ImportToDataExch(DataExchDef: Record "Data Exch. Def"): Boolean
var
Source: InStream;
ProgressWindow: Dialog;
IsHandled: Boolean;
begin
if not "File Content".HasValue() then
if not ImportFileContent(DataExchDef) then
exit(false);
Requested Event Publisher
[IntegrationEvent(false, false)]
local procedure (var DataExch: Record "Data Exch."; var DataExchDef: Record "Data Exch. Def"; var IsHandled: Boolean)
begin
end;