[Extensibility Request][FEC Audit File] new integration events on codeunit 10826 "Generate File FEC"
Nobody has claimed this yet.
- Dominant language
- AL
- Stars
- 683
- Forks
- 459
- Avg merge
- 3d 26m
- Merged PRs (30d)
- 633
Description
Why do you need this change?
Related to https://github.com/microsoft/BCApps/issues/10598
Currently the "FEC Audit File" extension lacks integration events, specifically in codeunit 10826 "Generate File FEC". Due to business requirements, we need to adjust several values during the audit file export process.
Describe the request
We suggest adding integration events on codeunit 10826 "Generate File FEC". For our business case only Party Name and G/L Account No. need to be adjusted.
1. OnAfterSetCustomerData — in GetLedgerEntryDataForCustVend, after the customer party data is resolved (GLSourceType::Customer branch):
procedure GetLedgerEntryDataForCustVend(TransactionNo: Integer; SourceType: Enum "Gen. Journal Source Type"; var PartyNo: Code[20]; var PartyName: Text[100]; var FCYAmount: Text[250]; var CurrencyCode: Code[10]; var DocNoSet: Text; var DateApplied: Date)
begin
case SourceType of
GLSourceType::Customer:
// ...
PartyNo := CustLedgerEntry."Customer No.";
PartyName := CustLedgerEntry."Customer Name";
+ OnAfterSetCustomerData(CustLedgerEntry, PartyName);
PayRecAccount := GetReceivablesAccount(CustLedgerEntry."Customer Posting Group");
// ...
end;
2. OnAfterSetVendorData — in the same GetLedgerEntryDataForCustVend procedure (GLSourceType::Vendor branch):
GLSourceType::Vendor:
// ...
PartyNo := VendorLedgerEntry."Vendor No.";
PartyName := VendorLedgerEntry."Vendor Name";
+ OnAfterSetVendorData(VendorLedgerEntry, PartyName);
PayRecAccount := GetPayablesAccount(VendorLedgerEntry."Vendor Posting Group");
// ...
3. OnWriteDetailedGLAccountBySourceOnBeforeAppendLine — in WriteDetailedGLAccountBySource, before appending the line:
local procedure WriteDetailedGLAccountBySource(GLAccountNo: Code[20]; GLAccountName: Text[100]; SourceNo: Code[20]; PartyName: Text[100]; Amount: Decimal)
begin
// ...
if Amount > 0 then
DebitAmt := Amount
else
CreditAmt := -Amount;
+ OnWriteDetailedGLAccountBySourceOnBeforeAppendLine(GLAccountNo);
AppendLine('00000|' +
'BALANCE OUVERTURE|' +
// ...
end;
4. OnWriteGLAccountOnBeforeAppendLine — in WriteGLAccount, before appending the line:
local procedure WriteGLAccount(GLAccountNo: Code[20]; GLAccountName: Text[100]; OpeningBalance: Decimal)
begin
if OpeningBalance > 0 then
DebitAmount := OpeningBalance
else
CreditAmount := Abs(OpeningBalance);
+ OnWriteGLAccountOnBeforeAppendLine(GLAccountNo);
AppendLine('00000|' +
'BALANCE OUVERTURE|' +
// ...
end;
5. OnWriteGLEntryToFileOnBeforeAppendLine — in WriteGLEntryToFile, before writing the entry line:
local procedure WriteGLEntryToFile(var GLEntry: Record "G/L Entry"; ProgressiveNo: Integer; GLRegisterCreationDate: Date; PartyNo: Code[20]; PartyName: Text[100]; FCYAmount: Text[250]; CurrencyCode: Code[10]; DocNoSet: Text; DateApplied: Date)
begin
GLEntry.CalcFields(GLEntry."G/L Account Name");
+ OnWriteGLEntryToFileOnBeforeAppendLine(GLEntry);
AppendLine(
GetSourceCode(GLEntry) + '|' +
// ...
end;
Event declarations:
+ [IntegrationEvent(false, false)]
+ local procedure OnAfterSetCustomerData(CustLedgerEntry: Record "Cust. Ledger Entry"; var PartyName: Text[100])
+ begin
+ end;
+
+ [IntegrationEvent(false, false)]
+ local procedure OnAfterSetVendorData(VendorLedgerEntry: Record "Vendor Ledger Entry"; var PartyName: Text[100])
+ begin
+ end;
+
+ [IntegrationEvent(false, false)]
+ local procedure OnWriteDetailedGLAccountBySourceOnBeforeAppendLine(var GLAccountNo: Code[20])
+ begin
+ end;
+
+ [IntegrationEvent(false, false)]
+ local procedure OnWriteGLAccountOnBeforeAppendLine(var GLAccountNo: Code[20])
+ begin
+ end;
+
+ [IntegrationEvent(false, false)]
+ local procedure OnWriteGLEntryToFileOnBeforeAppendLine(var GLEntry: Record "G/L Entry")
+ begin
+ end;
Provide an implementation (optional)
- I will provide the implementation for this extensibility request
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with codeunit 10826 "Generate File FEC", focusing on GetLedgerEntryDataForCustVend, WriteDetailedGLAccountBySource, WriteGLAccount, and WriteGLEntryToFile. Add the five requested integration events at the shown points and declarations, then verify that subscribers can adjust Party Name and G/L Account No. during audit file export.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100