microsoft / ALAppExtensions

Repository for collaboration on Microsoft AL application add-on and localization extensions for Microsoft Dynamics 365 Business Central.
MIT License
773 stars 610 forks source link

[Event Request] Codeunit 7045 "Price Asset - Service Cost" - OnAfterFillAdditionalFields #26726

Closed ZepposBE closed 3 months ago

ZepposBE commented 3 months ago

Describe the request

Hello development team,

For some of our features we would like to see the new event added as in the example code below.

local procedure FillAdditionalFields(var PriceAsset: Record "Price Asset")
    begin
        PriceAsset.Description := ServiceCost.Description;
        PriceAsset."Unit of Measure Code" := ServiceCost."Unit of Measure Code";
        PriceAsset."Variant Code" := '';
        case PriceAsset."Price Type" of
            PriceAsset."Price Type"::Sale:
                PriceAsset."Unit Price" := ServiceCost."Default Unit Price";
            PriceAsset."Price Type"::Purchase:
                begin
                    PriceAsset."Unit Price 2" := ServiceCost."Default Unit Cost";
                    PriceAsset."Unit Price" := 0;
                end;
        end;

         >>> New Event
        OnAfterFillAdditionalFields(PriceAsset, ServiceCost);
        <<< New Event
    end;
   [IntegrationEvent(false, false)]
    local procedure OnAfterFillAdditionalFields(var PriceAsset: Record "Price Asset" temporary; ServiceCost: Record "Service Cost")
    begin
    end;

There is only one caveat to this code example, the name of the variable in the OnAfterFillAdditionalFields event will have to be different because it's the same as the global variable, but I will leave this naming up to you according to your conventions.

Additional context

For some of our features we need to populate extra data from the Item Disc. Group into the Price Asset record. Business Central already already has these similar events for Item and Resource, but not for these other "Price Asset Types":

JesperSchulz commented 3 months ago

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

Build ID: 21487.