Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LC0063 - false positive for global variable #688

Open
pri-kise opened this issue Jul 9, 2024 · 2 comments
Open

LC0063 - false positive for global variable #688

pri-kise opened this issue Jul 9, 2024 · 2 comments
Labels
bug Something isn't working Resolved

Comments

@pri-kise
Copy link

pri-kise commented Jul 9, 2024

If we add a global variable to a page then the rule shouldn't trigger.
What i don't like is that the rule suggest DisplayName.

page 50000 "PTE API Dimension Values"
{
    APIGroup = 'projectapi';
    APIPublisher = 'defaultpublisher';
    APIVersion = 'v1.0';
    Caption = 'Dimension Values';
    ChangeTrackingAllowed = true;
    DelayedInsert = true;
    Editable = false;
    EntityCaption = 'Dimension Value';
    EntityName = 'dimensionValue';
    EntitySetCaption = 'Dimension Values';
    EntitySetName = 'dimensionValues';
    Extensible = false;
    ODataKeyFields = SystemId;
    PageType = API;
    SourceTable = "Dimension Value";

    layout
    {
        area(Content)
        {
            repeater(Lines)
            {
                Caption = 'Lines';
                ShowCaption = false;
                field(id; Rec.SystemId)
                {
                }
                field(dimensionCode; Rec."Dimension Code")
                {
                }
                field(dimensionName; DimensionGlobal.Name) // Wrong warning -> Or is this warnig really intended here?
                {
                }
                field("code"; Rec.Code)
                {
                }
                field(name; Rec.Name) // The warning here is correct for me.
                {
                }
                field(dimensionValueType; Rec."Dimension Value Type")
                {
                }
                field(blocked; Rec.Blocked)
                {
                }
            }
        }
    }
    var

        DimensionGlobal: Record Dimension;

    trigger OnAfterGetRecord()    begin
        if not DimensionGlobal.Get(Rec."Dimension Code") then
            DimensionGlobal.Init();
    end;
}
@Arthurvdv Arthurvdv added the bug Something isn't working label Jul 9, 2024
@Arthurvdv
Copy link
Collaborator

This is indeed a false positive, where the rule shouldn't be raised.

In the update pre-release version of the LinterCop v0.30.28 this should now been resolved.

@Arthurvdv
Copy link
Collaborator

The version v0.30.28 of the LinterCop is now the latest release. Could you verify if this is now working as expected? If this is the case, you may close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Resolved
Projects
None yet
Development

No branches or pull requests

2 participants