ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] codeunit 8611 "Config. Package Management" - multiple publishers

Open alapenas opened this issue 3 years ago • 3 comments

Hello, would it be possible to add OnModifyRecordDataFieldAfterUpdateValueUsingMapping, OnApplyPackageBeforeCleanPackageErrors, OnApplyPackageTablesOnFilterConfigPackageRecord event to codeunit 8611 "Config. Package Management", like this:

    local procedure ModifyRecordDataField(var ConfigPackageRecord: Record "Config. Package Record"; var ConfigPackageField: Record "Config. Package Field"; var ConfigPackageData: Record "Config. Package Data"; var ConfigPackageTable: Record "Config. Package Table"; var RecRef: RecordRef; DoModify: Boolean; DelayInsert: Boolean; ReadConfigPackageData: Boolean) 
... 
              UpdateValueUsingMapping(ConfigPackageData, ConfigPackageField, ConfigPackageRecord."Package Code");
 
             GetCachedConfigPackageField(ConfigPackageData);
             IsHandled := false;
>             OnModifyRecordDataFieldAfterUpdateValueUsingMapping(RecRef, FieldRef, ConfigPackageField, ConfigPackageData, IsHandled);//New Event
             if not IsHandled then
                 case true of
                     IsBLOBFieldInternal(TempConfigPackageFieldCache."Processing Order"):
                         EvaluateBLOBToFieldRef(ConfigPackageData, FieldRef); 
    procedure ApplyPackage(ConfigPackage: Record "Config. Package"; var ConfigPackageTable: Record "Config. Package Table"; SetupProcessingOrderForTables: Boolean) ErrorCount: Integer 
... 
              ErrorCount := ConfigPackage."No. of Errors";
         if (TableCount = 0) or (ConfigPackage."No. of Records" = 0) then
             exit;
         IsHandled := false;
>         OnApplyPackageBeforeCleanPackageErrors(ConfigPackage, IsHandled);//New Event
         if not IsHandled then
             if (ConfigPackage.Code <> MSGPPackageCodeTxt) and (ConfigPackage.Code <> QBPackageCodeTxt) then
                 // Skip this code to hold the error count for duplicate records.
                 CleanPackageErrors(ConfigPackage.Code, ConfigPackageTable.GetFilter("Table ID")); 
    local procedure ApplyPackageTables(ConfigPackage: Record "Config. Package"; var ConfigPackageTable: Record "Config. Package Table"; ApplyMode: Option ,PrimaryKey,NonKeyFields) 
... 
              repeat
                 ConfigPackageTable.CalcFields("Table Name");
                 ConfigPackageRecord.SetRange("Package Code", ConfigPackageTable."Package Code");
                 ConfigPackageRecord.SetRange("Table ID", ConfigPackageTable."Table ID");
>                 OnApplyPackageTablesOnFilterConfigPackageRecord(ConfigPackage, ConfigPackageRecord);//New Event
                 if not HideDialog then
                     ConfigProgressBar.Update(ConfigPackageTable."Table Name");
                 if not IsTableErrorsExists(ConfigPackageTable) then// Added to show item duplicate errors
                     ApplyPackageRecords( 
  
     [IntegrationEvent(false, false)]
     local procedure OnModifyRecordDataFieldAfterUpdateValueUsingMapping(var RecRef: RecordRef; var FieldRef: FieldRef; var ConfigPackageField: Record "Config. Package Field"; var ConfigPackageData: Record "Config. Package Data"; var IsHandled: Boolean)
     begin
     end; 
  
     [IntegrationEvent(false, false)]
     local procedure OnApplyPackageBeforeCleanPackageErrors(var ConfigPackage: Record "Config. Package"; var IsHandled: Boolean)
     begin
     end; 
  
     [IntegrationEvent(false, false)]
     local procedure OnApplyPackageTablesOnFilterConfigPackageRecord(var ConfigPackage: Record "Config. Package"; var ConfigPackageRecord: Record "Config. Package Record")
     begin
     end; 

alapenas avatar Feb 27 '23 16:02 alapenas

Please explain the purpose of these events?

AlexanderYakunin avatar Apr 05 '23 08:04 AlexanderYakunin

Hi @AlexanderYakunin, thank you for the replay. Publishers OnApplyPackageBeforeCleanPackageErrors and OnApplyPackageTablesOnFilterConfigPackageRecord allow skipping duplicate errors from deletion. The publisher OnModifyRecordDataFieldAfterUpdateValueUsingMapping allows altering FieldRef value and avoids standard Evaluation procedures.

alapenas avatar Apr 05 '23 09:04 alapenas

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: 11137.

JesperSchulz avatar Jun 15 '23 15:06 JesperSchulz