ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] codeunit 170 "Standard Codes Mgt." - multiple publishers

Open gretanorv opened this issue 4 years ago • 2 comments

Hello, would it be possible to add OnCheckCreateSalesRecurringLinesBeforeApply, OnGetSalesRecurringLinesBeforeApply event to codeunit 170 "Standard Codes Mgt.", like this:

    procedure CheckCreateSalesRecurringLines(SalesHeader: Record "Sales Header") 
... 
          IF (StandardCustomerSalesCode.Count = 1) AND
            StandardCustomerSalesCode.IsInsertRecurringLinesOnDocumentAutomatic(SalesHeader)
         then begin
             IsHandled := false;
>             OnCheckCreateSalesRecurringLinesBeforeApply(SalesHeader, StandardCustomerSalesCode, IsHandled); //New Event
             if not IsHandled then
                 StandardCustomerSalesCode.ApplyStdCodesToSalesLines(SalesHeader, StandardCustomerSalesCode, 0D, 0D);
         end else
             ShowGetSalesRecurringLinesNotification(SalesHeader); 
    procedure GetSalesRecurringLines(SalesHeader: Record "Sales Header") 
... 
          if (StandardCustomerSalesCode.Count = 1) and
            StandardCustomerSalesCode.IsInsertRecurringLinesOnDocumentAutomatic(SalesHeader)
         then begin
             IsHandled := false;
>             OnGetSalesRecurringLinesBeforeApply(SalesHeader, StandardCustomerSalesCode, IsHandled); //New Event
             if not IsHandled then
                 StandardCustomerSalesCode.ApplyStdCodesToSalesLines(SalesHeader, StandardCustomerSalesCode, 0D, 0D);
         end else
             StandardCustomerSalesCode.InsertSalesLines(SalesHeader); 
    local procedure OnCheckCreateSalesRecurringLinesBeforeApply(SalesHeader: Record "Sales Header"; StandardCustomerSalesCode: Record "Standard Customer Sales Code"; var IsHandled: Boolean)  
    local procedure OnGetSalesRecurringLinesBeforeApply(SalesHeader: Record "Sales Header"; StandardCustomerSalesCode: Record "Standard Customer Sales Code"; var IsHandled: Boolean)  

gretanorv avatar Oct 19 '22 12:10 gretanorv

This will be OnBeforeApplyStdCodesToSalesLinesProcedure in ApplyStdCodesToSalesLines

Vadim-Stepanenko avatar Nov 03 '22 16:11 Vadim-Stepanenko

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.

AlexanderYakunin avatar Nov 13 '22 11:11 AlexanderYakunin