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

LC0067 - false positve for Journal Template Tables #710

Open
pri-kise opened this issue Jul 18, 2024 · 3 comments
Open

LC0067 - false positve for Journal Template Tables #710

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

Comments

@pri-kise
Copy link

I receive the warning The NotBlank property should be set to false (or removed) if a TableRelation of 'No. Series' is present on the table.for a Journal Template table.

The table has a similiar structure like the Job Journal Template.

a primary key

        field(1; Name; Code[10])
        {
            Caption = 'Name';
            NotBlank = true;
        }

and a "No. Series" field.

        field(16; "No. Series"; Code[20])
        {
            Caption = 'No. Series';
            TableRelation = "No. Series";

            trigger OnValidate()
            begin
                if "No. Series" <> '' then begin
                    if Recurring then
                        Error(
                          Text000,
                          FieldCaption("Posting No. Series"));
                    if "No. Series" = "Posting No. Series" then
                        "Posting No. Series" := '';
                end;
            end;
        }

I can use a pragma for this table but I wanted to track this false positive issue

@Arthurvdv Arthurvdv added the bug Something isn't working label Jul 18, 2024
@Arthurvdv
Copy link
Collaborator

Arthurvdv commented Jul 18, 2024

You're right, in this scenario the rule shouldn't be raised.

Some thoughts here

  • Exclude the rule on the word Template in the name of the table (could become messy on handeling abbreviations like, Tmpl. , Templ. , ...)
  • Only raise rule when FieldName equals "No."
  • ...

@janvtBE Do you maybe have some idea's on howto prevent these false positives?

@janvtBE
Copy link

janvtBE commented Jul 18, 2024

@Arthurvdv instead of "only raise rule when FieldName equals No.", maybe turn it around: don't raise the rule when FieldName equals "Name". Because you can also have "Code" as PK field, or maybe another value and in those cases the rule must raise.

@Arthurvdv
Copy link
Collaborator

Good idea @janvtBE, hopefully this will be enough to prevent other false positives.

@pri-kise the updated pre-release should now no longer raise this false positive.

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

3 participants