[IT][Event Request][Codeunit][12173] "Vendor Bill List - Post" - Function PostVendorBillLine() & Function PostBalanceAccount()
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 66/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- backend
Research direction
Open Codeunit 12173 "Vendor Bill List - Post" and locate the procedures PostVendorBillLine() and PostBalanceAccount(). Add the two [IntegrationEvent(false, false)] declarations exactly as given in the issue, introduce the IsHandled variable, and wrap the Gen. Journal Line initialization block in if not IsHandled then begin ... end; while keeping the existing OnBefore* events and GenJnlPostLine.RunWithCheck calls outside the guard. Done when the AL package compiles and the new events are callable from an extension; note this is a Microsoft-owned repo where extensibility requests are triaged, so confirm maintainers accept the change before investing.
Written by the indexing model from the issue text.
Description
Why do you need this change?
Hello,
We would need new events in the "PostVendorBillLine" and "PostBalanceAccount" procedures of Codeunit 12173 "Vendor Bill List - Post", in order to manage custom fields.
New Events and Code:
procedure PostVendorBillLine(var GenJnlLine: Record "Gen. Journal Line"; VendorBillHeader: Record "Vendor Bill Header"; VendorBillLine: Record "Vendor Bill Line"; VendLedgEntry: Record "Vendor Ledger Entry"; Bill: Record Bill; var AmountLCY: Decimal)
var
Tax: Option " ",Withhold,"Free Lance",Company;
//New Variable
IsHandled: Boolean;
begin
GenJnlLine.Init();
//New Code
IsHandled:=False;
OnAfterInitGenJnlLineOnPostVendorBillLine(GenJnlLine,VendorBillHeader,VendorBillLine,VendLedgEntry,Bill,AmountLCY,IsHandled);
if not IsHandled then begin
//
GenJnlLine.Validate("Posting Date", VendorBillHeader."Posting Date");
GenJnlLine."Document Type" := GenJnlLine."Document Type"::Payment;
GenJnlLine."Document No." := VendorBillHeader."Vendor Bill List No.";
GenJnlLine."Document Date" := VendorBillHeader."List Date";
GenJnlLine."Account Type" := GenJnlLine."Account Type"::Vendor;
GenJnlLine.Validate("Account No.", VendorBillLine."Vendor No.");
GenJnlLine."Due Date" := VendorBillLine."Due Date";
GenJnlLine."External Document No." := VendorBillLine."Vendor Bill List No.";
GenJnlLine.Validate(Amount, VendorBillLine."Amount to Pay");
GenJnlLine.Validate("Currency Code", VendorBillHeader."Currency Code");
if not VendorBillLine."Manual Line" then begin
GenJnlLine.Validate("Salespers./Purch. Code", VendLedgEntry."Purchaser Code");
ApplyInvAndUpdateLedgEntry(GenJnlLine, VendorBillLine, Tax::" ");
end else
GenJnlLine."Applies-to Occurrence No." := VendorBillLine."Document Occurrence";
GenJnlLine.Description := Bill.Description;
GenJnlLine."Source Code" := Bill."Vend. Bill Source Code";
GenJnlLine."System-Created Entry" := true;
GenJnlLine."Reason Code" := VendorBillHeader."Reason Code";
GenJnlLine."Shortcut Dimension 1 Code" := VendLedgEntry."Global Dimension 1 Code";
GenJnlLine."Shortcut Dimension 2 Code" := VendLedgEntry."Global Dimension 2 Code";
if not VendorBillLine."Manual Line" then
GenJnlLine."Dimension Set ID" := VendLedgEntry."Dimension Set ID"
else
GenJnlLine."Dimension Set ID" := VendorBillLine."Dimension Set ID";
GenJnlLine."Payment Method Code" := VendorBillHeader."Payment Method Code";
AmountLCY := GenJnlLine."Amount (LCY)";
//New Code
end;
//
OnBeforePostVendorBillLine(GenJnlLine, VendorBillHeader, VendorBillLine, VendLedgEntry);
GenJnlPostLine.RunWithCheck(GenJnlLine);
end;
procedure PostBalanceAccount(GenJnlLine: Record "Gen. Journal Line"; VendorBillHeader: Record "Vendor Bill Header"; VendorBillLine: Record "Vendor Bill Line"; VendLedgEntry: Record "Vendor Ledger Entry"; Bill: Record Bill)
var
IsHandled:Boolean;
begin
GenJnlLine.Init();
//New Code
IsHandled:=False; OnAfterInitGenJnlLineOnPostBalanceAccount(GenJnlLine,VendorBillHeader,VendorBillLine,VendLedgEntry,Bill,IsHandled);
if not IsHandled then begin
//
GenJnlLine.Validate("Posting Date", VendorBillHeader."Posting Date");
GenJnlLine."Document Type" := GenJnlLine."Document Type"::Payment;
GenJnlLine."Document No." := VendorBillHeader."Vendor Bill List No.";
GenJnlLine."Document Date" := VendorBillHeader."List Date";
GenJnlLine."Account Type" := GenJnlLine."Account Type"::"Bank Account";
GenJnlLine.Validate("Account No.", VendorBillHeader."Bank Account No.");
GenJnlLine."Currency Code" := VendorBillHeader."Currency Code";
GenJnlLine.Validate(Amount, -BalanceAmount);
GenJnlLine.Validate("Amount (LCY)", -BalanceAmountLCY);
GenJnlLine.Description := Bill.Description;
GenJnlLine."Source Code" := Bill."Vend. Bill Source Code";
GenJnlLine."System-Created Entry" := true;
GenJnlLine."Reason Code" := VendorBillHeader."Reason Code";
if not VendorBillLine."Manual Line" then
GenJnlLine.Validate("Salespers./Purch. Code", VendLedgEntry."Purchaser Code");
GenJnlLine."Shortcut Dimension 1 Code" := VendLedgEntry."Global Dimension 1 Code";
GenJnlLine."Shortcut Dimension 2 Code" := VendLedgEntry."Global Dimension 2 Code";
if not VendorBillLine."Manual Line" then
GenJnlLine."Dimension Set ID" := VendLedgEntry."Dimension Set ID"
else
GenJnlLine."Dimension Set ID" := VendorBillLine."Dimension Set ID";
//New Code
end;
//
GenJnlLine.CreateDimFromDefaultDim(GenJnlLine.FieldNo("Account No."));
OnBeforePostBalanceAccount(GenJnlLine, VendorBillHeader, VendorBillLine, VendLedgEntry);
GenJnlPostLine.RunWithCheck(GenJnlLine);
end;
Signature:
[IntegrationEvent(false, false)]
OnAfterInitGenJnlLineOnPostVendorBillLine(var GenJnlLine: Record "Gen. Journal Line"; VendorBillHeader: Record "Vendor Bill Header"; VendorBillLine: Record "Vendor Bill Line"; VendLedgEntry: Record "Vendor Ledger Entry"; Bill: Record Bill; var AmountLCY: Decimal;var IsHandled:Boolean)
begin
end;
[IntegrationEvent(false, false)]
OnAfterInitGenJnlLineOnPostBalanceAccount(GenJnlLine: Record "Gen. Journal Line"; VendorBillHeader: Record "Vendor Bill Header"; VendorBillLine: Record "Vendor Bill Line"; VendLedgEntry: Record "Vendor Ledger Entry"; Bill: Record Bill;var IsHandled:Boolean)
begin
end;
Thank You,
Luca
Describe the request
We need this events to be able to manage custom fields on the Line Insert procedures, and we need to manage the validate triggers of the fields.
This request is a follow-up to an issue opened about a year ago. The requested change has not yet been implemented in the Business Central Base Application.
For reference, please see the previous discussion: https://github.com/microsoft/ALAppExtensions/issues/29093#issuecomment-3883244614
Provide an implementation (optional)
- I will provide the implementation for this extensibility request
- Dominant language
- AL
- Stars
- 697
- Forks
- 473
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 493
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from microsoft/BCApps
-
missing-info Team: Finance
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
microsoft/BCApps#12900 · 1 comment ·
Maintainers usually reply within 1 day
-
missing-info Team: Finance
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
microsoft/BCApps#12893 · 5 comments ·
Maintainers usually reply within 1 day
-
[W1][Extensibility Request][Subscription Billing] Remove local access from InitTempTable() procedure on page 8025 "Contract Price Update"Possibly taken @business-central-extensibility-bot claimed this 1 day ago. OpenApproved ext-ready-to-implement request-for-external Team: Finance
Difficulty 1/5 Under an hour Newbie friendliness 70/100
microsoft/BCApps#12775 · 2 comments ·
Maintainers usually reply within 1 day
-
[W1][MultiObjects] Output journal lines: event after CheckWhse in codeunits 5406 "Output Jnl.-Expl. Route" and 5510 "Production Journal Mgt"Possibly taken @PredragMaricic claimed this 2 days ago. OpenApproved Team: SCM
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
microsoft/BCApps#12652 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
"Warehouse Request" has wrong Table Relation for "Shipping Agent Service Code"Possibly taken @PredragMaricic claimed this 2 days ago. OpenApproved Team: SCM
Difficulty 1/5 Under an hour Newbie friendliness 75/100
microsoft/BCApps#12623 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
All issues in microsoft/BCApps
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
`/search.json` ignores the documented `editions.sort` parameterPossibly taken @PranavD2905 claimed this today. OpenAffects: Server Good First Issue Module: Solr Needs: Triage Theme: Public APIs Theme: Search
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
internetarchive/openlibrary#13989 · 1 comment ·
Maintainers usually reply within 1 day
-
bug P2: misleading query
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
jeffknupp/association#478 ·
-
backend bug difficulty: medium priority: medium reliability
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
trustflow-protocol/trustflow-backend#730 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
firecrawl/firecrawl-mcp-server#548 ·
Maintainers usually reply within 1 day