**Could we please have a new event "OnAfterParseHeaderRecord" in function "ParseHeaderRecord" and
a new event "OnAfterCheckOldBalance" in function "CheckOldBalance" of Codeunit 2000040 "Coda Import Management"?
local procedure ParseHeaderRecord()
begin
with CodBankStmtSrcLine do begin
ProtocolNo := CopyStr(Data, 12, 3);
VersionCode := CopyStr(Data, 128, 1);
if VersionCode = '1' then
VId[1] := DelChr(CopyStr(Data, 61, 11), '>', ' ')
else
SWIFTCode := DelChr(CopyStr(Data, 61, 11));
VId[2] := DelChr(CopyStr(Data, 72, 11), '>', ' ');
"Transaction Date" := DDMMYY2Date(CopyStr(Data, 6, 6), false);
// --- Begin New Code ---
OnAfterParseHeaderRecord(CodBankStmtSrcLine);
// --- End New Code ---
end;
end;
procedure CheckOldBalance(var CodedBankStmtSrcLine: Record "CODA Statement Source Line"): Boolean
var
BankAccountNo: Text[30];
IBANNumber: Text[34];
begin
CodBankStmtSrcLine := CodedBankStmtSrcLine;
with CodBankStmtSrcLine do begin
Evaluate("Statement No.", CopyStr(Data, 3, 3));
BankAccountNo :=
PaymJnlManagement.ConvertToDigit(
BankAcc."Bank Account No.",
MaxStrLen(BankAcc."Bank Account No."));
IBANNumber := DelChr(BankAcc.IBAN);
AccountType := CopyStr(Data, 2, 1);
case AccountType of
' ', '0':
if BankAccountNo <> CopyStr(Data, 6, 12) then
Error(Text003,
BankAcc.FieldCaption("Bank Account No."),
BankAcc."Bank Account No.",
BankAcc.TableCaption(),
BankAcc."No.",
CopyStr(Data, 6, 12),
ID);
'2':
if IBANNumber <> CopyStr(Data, 6, 16) then
Error(Text003,
BankAcc.FieldCaption(IBAN),
BankAcc.IBAN,
BankAcc.TableCaption(),
BankAcc."No.",
CopyStr(Data, 6, 16),
ID);
else
Error(Text017);
end;
if Data[43] = '0' then
Evaluate(Amount, CopyStr(Data, 44, 15))
else
Evaluate(Amount, '-' + CopyStr(Data, 44, 15));
Amount := Amount / 1000;
"Transaction Date" := DDMMYY2Date(CopyStr(Data, 59, 6), false);
Evaluate("CODA Statement No.", CopyStr(Data, 126, 3));
Evaluate(CODAStatementNo, CopyStr(Data, 3, 3));
// --- Begin New Code ---
OnAfterCheckOldBalance(CodBankStmtSrcLine,CODAStatementNo);
// --- End New Code ---
[IntegrationEvent(false, false)]
local procedure OnAfterParseHeaderRecord(var CODAStatementLine: Record "CODA Statement Line")
begin
end;
[IntegrationEvent(false, false)]
local procedure OnAfterCheckOldBalance(var CODAStatementLine: Record "CODA Statement Line"; var CODAStatementNo: Text[30])
begin
end;
Additional context
We would like to read the year out of the statement date (found in header record of CODA file) and add it as a prefix to the Statement No. (found in the OldBalance record of the CODA file).
This in order to prevent that a CODA statement will be overwritten the next year.
Internal work item: AB#537214
Describe the request
Hello,
**Could we please have a new event "OnAfterParseHeaderRecord" in function "ParseHeaderRecord" and a new event "OnAfterCheckOldBalance" in function "CheckOldBalance" of Codeunit 2000040 "Coda Import Management"?
// --- Begin New Code --- OnAfterParseHeaderRecord(CodBankStmtSrcLine); // --- End New Code ---
// --- Begin New Code --- OnAfterCheckOldBalance(CodBankStmtSrcLine,CODAStatementNo); // --- End New Code ---
...
...
[IntegrationEvent(false, false)] local procedure OnAfterParseHeaderRecord(var CODAStatementLine: Record "CODA Statement Line") begin end;
[IntegrationEvent(false, false)] local procedure OnAfterCheckOldBalance(var CODAStatementLine: Record "CODA Statement Line"; var CODAStatementNo: Text[30]) begin end;
Additional context
We would like to read the year out of the statement date (found in header record of CODA file) and add it as a prefix to the Statement No. (found in the OldBalance record of the CODA file).
This in order to prevent that a CODA statement will be overwritten the next year. Internal work item: AB#537214