action("CreateFile")
{
ApplicationArea = all;
Caption = 'Create EFT File';
Image = "Report";
Promoted = true;
PromotedCategory = "Process";
PromotedIsBig = true;
Visible = CreateEFTExternalDocVisible;
ToolTip = 'Executes the Create EFT File action.';
trigger OnAction()
var
BankAcc: Record "Bank Account";
EFTManagement: Codeunit <YourCU>
begin
if not Confirm(ConfirmExportQst, false, rec."No.") then
Error('');
if BankAcc.Get(rec."Bank Account Code") then
EFTManagement.CreateFileFromEFTRegister(Rec, rec."File Description", BankAcc);
end;
}
procedure CreateFileFromEFTRegister(var EFTRegister: Record "EFT Register";FileDescription: Text[12];var BankAcc: Record "Bank Account")
begin
GetSetup;
if EFTRegister."EFT Payment" then begin
EFTRegister.TestField(Canceled, false);
OpenFile;
//CreateFileEFTPayment(EFTRegister, FileDescription, BankAcc);
CloseFile(EFTRegister, FileDescription, BankAcc);
end;
end;
procedure CloseFile(EFTRegister: Record "EFT Register"; FileDescription: Text[12]; BankAccount: Record "Bank Account")
var
NewStream: InsTream;
FileMgt: Codeunit "File Management";
begin
EFTRegister.LockTable();
EFTRegister.Find;
EFTRegister."Total Amount (LCY)" := TotalAmountLCY;
EFTRegister."File Created" := Today;
EFTRegister.Time := Time;
EFTRegister."File Description" := FileDescription;
EFTRegister."Bank Account Code" := BankAccount."No.";
EFTRegister.Modify();
Tempblob.CreateInStream(EFTFileInstream);
ServerFileName := gvfileDescription + '.aba';
IF CanDownloadFile THEN BEGIN
DOWNLOADFROMSTREAM(EFTFileInstream, 'Export', '', '', ServerFileName);
MESSAGE(Text11002, TotalAmountLCY);
END;
end;
André Arnaud de Cal... 291,391 Super User 2024 Season 2
Martin Dráb 230,445 Most Valuable Professional
nmaenpaa 101,156