-
Notifications
You must be signed in to change notification settings - Fork 691
Description
Why do you need this change?
At 4PS Construct, we require the ability to access the CustInvDiscFound boolean value in our event subscribers to implement custom business logic that depends on whether a customer invoice discount record was found. Currently, the OnCalculateInvoiceDiscountOnBeforeCheckCustInvDiscServiceCharge integration event in codeunit 60 "Sales-Calc. Discount" does not include the CustInvDiscFound parameter, which prevents event subscribers from determining if a valid invoice discount record exists before the service charge check is performed.
The CustInvDiscFound variable is calculated just before this event is raised (via CustInvDisc.GetRecord()) and represents critical information for decision-making in discount calculation scenarios. Without access to this parameter, event subscribers cannot properly extend the invoice discount calculation logic to handle cases where discount records may or may not exist.
To ensure that event subscribers can make informed decisions based on whether a discount record was found, we need to add the CustInvDiscFound Boolean parameter to this event signature. This change aligns the event with best practices by providing all relevant context to subscribers at the appropriate point in the process.
Describe the request
Dear ALAppExtensions team,
On behalf of 4PS, I would like to request to add the CustInvDiscFound Boolean parameter to the OnCalculateInvoiceDiscountOnBeforeCheckCustInvDiscServiceCharge integration event in codeunit 60 "Sales-Calc. Discount".
Current event:
[IntegrationEvent(false, false)]
local procedure OnCalculateInvoiceDiscountOnBeforeCheckCustInvDiscServiceCharge(var CustInvoiceDisc: Record "Cust. Invoice Disc."; var SalesHeader: Record "Sales Header"; CurrencyDate: Date; ChargeBase: Decimal)
begin
end;
Suggested extensibility:
[IntegrationEvent(false, false)]
local procedure OnCalculateInvoiceDiscountOnBeforeCheckCustInvDiscServiceCharge(var CustInvoiceDisc: Record "Cust. Invoice Disc."; var SalesHeader: Record "Sales Header"; CurrencyDate: Date; ChargeBase: Decimal; CustInvDiscFound: Boolean)
begin
end;
Internal work item: AB#621788