AL icon indicating copy to clipboard operation
AL copied to clipboard

AA0232 The FlowField XXX of "TableName" should be added to the SIFT key.

Open salgiza opened this issue 6 years ago • 37 comments

Describe the bug The rule does not seem to be working correctly.

To Reproduce We haven't been able to reproduce it outside our app (a test app using the same VSCode extension and BC server, with identical code as the one below does not raise the warning). There is something else that I must be missing, but I'm posting it here to see if we can find what.

This is, after a few simplifications, the code I've left in one table field (the original CalcFormula was much more complex):

    field(7142200; "IDPWHS Qty. Buffer"; Decimal)
    {
        CalcFormula = Sum("IDPWHS Read Buffer".Quantity where("Doc No." = field("Document No.")));
        Caption = 'Qty. Read';
        Editable = false;
        FieldClass = FlowField;
        DecimalPlaces = 0 : 5;
    }

It raises this warning: The FlowField Quantity of "IDPWHS Read Buffer" should be added to the SIFT key.

This is the key I've created for that CalcFormula, in the "IDPWHS Read Buffer" table:

    key(Key7; "Doc No.")
    {
        SumIndexFields = Quantity;
    }

Just for reference, this are the "Doc No." and "Quantity" fields:

    field(2; "Doc No."; Code[20])
    {
        Caption = 'Document No.';
        DataClassification = CustomerContent;
    }
    field(6; Quantity; Decimal)
    {
        Caption = 'Quantity';
        DataClassification = CustomerContent;
        DecimalPlaces = 0 : 5;
    }

Expected behavior There is a SIFT index for the required key and the Quantity field, so no warnings should be raised.

5. Versions:

  • AL Language: 6.0.324421
  • Business Central: 16.

salgiza avatar Sep 14 '20 08:09 salgiza

I can verify that I have the same issue with the rule.

MattTraxinger avatar Oct 02 '20 15:10 MattTraxinger

Confirmed, the warning still fires when it has been fixed very specifically: see warning here:

image

but see the key I added just for that purpose here:

image

dzzzb avatar Oct 06 '20 09:10 dzzzb

It seems this is also another warning that fires for keys that exist in the base application but to which we cannot add SumIndexFields, which it should not do until we can add them... no point telling us 'you should do X' when you don't let us ;-)

dzzzb avatar Oct 06 '20 09:10 dzzzb

Same here. Take a look at this example. I get a warning on field 84 but not 85 even though they are delcared in the same way and use the same underlying table and key.

image image

larswestman avatar Oct 08 '20 20:10 larswestman

I have a bit different problem. The rule does not respect field type, so if we use max on a date field (to find the last date) the warning is useless (SIFT index is for the numeric fields only)...

image

TKapitan avatar Oct 08 '20 20:10 TKapitan

Confirmed.. this doesn't make sense either.. image

waldo1001 avatar Oct 09 '20 12:10 waldo1001

Same here, I have added an extension field for Vendor Table and Get sum to form my customize table, I have set SumIndexFields but still appear this misleading information

image

image

image

mplze avatar Nov 13 '20 06:11 mplze

I can also confirm that this is still creating false errors.

mjmatthiesen avatar Jan 06 '21 18:01 mjmatthiesen

Happened to me on a Boolean field!

Screenshot 2021-01-20 at 15 36 48 (2)

nareshwar avatar Jan 20 '21 15:01 nareshwar

Slightly different twist (I think):

tableextension 50000 "My Purch. Inv. Line" extends "Purch. Inv. Line" { fields { field(50000; "My Application Entry No."; Integer) { } } keys { key(AE1; "My Application Entry No.") { SumIndexFields = Quantity; } } }

Above code leads to an error: "The property 'SumIndexFields' can only be set if the specified fields are from the same table.",

Fair enough.

But in another table linking to field in this table extension I get the AA0232 warning, that Quantity must be included in SIFT.

yrest avatar Jun 15 '21 07:06 yrest

Hello @PaulIvan, is there any progress on this and generally any ETA?

Koubek avatar Jun 16 '21 08:06 Koubek

Any progress?

GreatScott000 avatar Jul 01 '21 07:07 GreatScott000

Anything happening with this? This warning is very useful when it acts correctly, but with all the false warnings and the fact it isn't even recognizing the things I'm fixing I am afraid I have to disable this rule, which is a huge shame.

MikeGlue avatar Jul 21 '21 20:07 MikeGlue

Still hoping for an update on the status of this.

GreatScott000 avatar Aug 25 '21 15:08 GreatScott000

The false warnings are still there. Waiting for a solution..

atlanta11950 avatar Oct 12 '21 08:10 atlanta11950

I want an ETA as much as anyone else, but each of our comments like this just sends another useless email to 18 people... Let's just upvote the original post and the replies that say what we want, instead of repeating things over and over again.

dzzzb avatar Oct 12 '21 08:10 dzzzb

I know Repos where Issues that no longer get comments are removed because of "not relevant" or "looks like resolved". So: Hi to the other 19 People who not ignore warnings, I had the same wrong warning....

aptMattKoe avatar Nov 19 '21 14:11 aptMattKoe

I have this problem as well.

ghost avatar Feb 02 '22 08:02 ghost

Also having this problem

BaltzerLogicpartner avatar Feb 23 '22 08:02 BaltzerLogicpartner

Still seeing this problem! (AL Language v9.0.586671)

PrebenRasmussen avatar Feb 27 '22 21:02 PrebenRasmussen