ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Question] Extension C8617 Config. Validate Management

Open Joneleth84 opened this issue 6 years ago • 1 comments

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;

Joneleth84 avatar Oct 06 '20 16:10 Joneleth84

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.

bc-ghost avatar Nov 22 '20 13:11 bc-ghost