[Event Request] codeunit 8612 "Config. Template Management" - multiple publishers
Hello, would it be possible to add OnInsertRecordWithKeyFieldsBeforeValidateFieldValue, OnApplyTemplateLinesWithoutValidationBeforeValidateFieldValue events to codeunit 8612 "Config. Template Management", like this:
local procedure InsertRecordWithKeyFields(var RecRef: RecordRef; ConfigTemplateHeader: Record "Config. Template Header")
...
for KeyFieldCount := 1 to KeyRef.FieldCount do begin
FieldRef := KeyRef.FieldIndex(KeyFieldCount);
ConfigTemplateLine.SetRange("Field ID", FieldRef.Number);
if ConfigTemplateLine.FindFirst() then begin
> OnInsertRecordWithKeyFieldsBeforeValidateFieldValue(ConfigTemplateHeader, ConfigTemplateLine);//New Event
ConfigValidateMgt.ValidateFieldValue(
RecRef, FieldRef, ConfigTemplateLine."Default Value", false, ConfigTemplateLine."Language ID")
end else
if KeyRef.FieldCount <> 1 then
procedure ApplyTemplateLinesWithoutValidation(ConfigTemplateHeader: Record "Config. Template Header"; var RecordRef: RecordRef)
...
repeat
if ConfigTemplateLine.Type = ConfigTemplateLine.Type::Field then
if RecordRef.FieldExist(ConfigTemplateLine."Field ID") then begin
FieldRef := RecordRef.Field(ConfigTemplateLine."Field ID");
> OnApplyTemplateLinesWithoutValidationBeforeValidateFieldValue(ConfigTemplateHeader, ConfigTemplateLine);//New Event
ConfigValidateMgt.ValidateFieldValue(
RecordRef, FieldRef, ConfigTemplateLine."Default Value", true, ConfigTemplateLine."Language ID");
RecordRef.Modify(false);
OnApplyTemplLinesWithoutValidationAfterRecRefCheck(ConfigTemplateHeader, ConfigTemplateLine, RecordRef);
[IntegrationEvent(false, false)]
local procedure OnInsertRecordWithKeyFieldsBeforeValidateFieldValue(var ConfigTemplateHeader: Record "Config. Template Header"; var ConfigTemplateLine: Record "Config. Template Line")
begin
end;
[IntegrationEvent(false, false)]
local procedure OnApplyTemplateLinesWithoutValidationBeforeValidateFieldValue(var ConfigTemplateHeader: Record "Config. Template Header"; var ConfigTemplateLine: Record "Config. Template Line")
begin
end;
Please explain the purpose of this events? Which scenario you need to add?
Hi @AlexanderYakunin, we would like to alter the value of ConfigTemplateLine."Default Value" depending on additional conditions before passing it to ConfigValidateMgt.ValidateFieldValue().
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.