[Question] Extension C8617 Config. Validate Management
Hello!
We wanted to extended the Config. Validate Management codeunit for our customer and realized that we have no chance to circumvent the rather odd behaviour of the Import Package / Package Configuration functionality.
The culprit seems to be this function:
local procedure CopyRecRefFields(RecRef: RecordRef; SourceRecRef: RecordRef; FieldRefToExclude: FieldRef)
var
FieldRef: FieldRef;
SourceFieldRef: FieldRef;
FieldCount: Integer;
begin
for FieldCount := 1 to SourceRecRef.FieldCount do begin
SourceFieldRef := SourceRecRef.FieldIndex(FieldCount);
if FieldRefToExclude.Name = SourceFieldRef.Name then
exit;
FieldRef := RecRef.FieldIndex(FieldCount);
FieldRef.Value := SourceFieldRef.VALUE();
end;
end;
Rather than skipping fields that should be excluded, the code copies fields of the recordref UNTIL an exclusion occurs - in this case the whole loop is exited and the fields are only partially copied. We would appreciate it if the code works like that:
local procedure CopyRecRefFields(RecRef: RecordRef; SourceRecRef: RecordRef; FieldRefToExclude: FieldRef)
var
FieldRef: FieldRef;
SourceFieldRef: FieldRef;
FieldCount: Integer;
begin
for FieldCount := 1 to SourceRecRef.FieldCount do begin
SourceFieldRef := SourceRecRef.FieldIndex(FieldCount);
if FieldRefToExclude.Name <> SourceFieldRef.Name then begin
FieldRef := RecRef.FieldIndex(FieldCount);
FieldRef.Value := SourceFieldRef.VALUE();
end;
end;
end;
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. We will update this issue with information about availability.