Skip to content

Looping warning AL0254 and AL0885/AL0836 #8265

@fridrichovsky

Description

@fridrichovsky

1. Describe the bug
Looping warning without solution.

I have action that open page with source table "Capacity Ledger Entry".

RunObject = page "Capacity List ISH";
RunPageLink = "Order No." = field("No.");
RunPageView = sorting("Order No.", "Order Line No.", "Routing No.", "Routing Reference No.", "Operation No.", "Last Output Line");

line with sorting generate warning: Sorting field 'Routing No.' should be part of the keys for table 'Capacity Ledger Entry'. Add the field to a key definition to improve performance AL0254. Other fields are mentioned also.

When I create table extension for "Capacity Ledger Entry" with required key

    keys
    {
        key("Key55000 ISH"; "Scrap Unresolved ISH") { }
        key("Scrap ISH"; "Order Type", "Order No.", "Order Line No.") { }
        key("Key1ISH"; "Order No.", "Order Line No.", "Routing No.", "Routing Reference No.", "Operation No.", "Last Output Line") { }
    }

I get warning: The Key 'Key1ISH' contains a reference to the field 'Routing No.' which is defined in another object from the same app. If you are preparing to move this object to another extension in the future, this reference will be an issue.

When I remove the key, I'm back at the beginning.

The "Capacity Ledger Entry" is table from Base Application so it should work. Same information are in BC web client where fields are part of one table.

Main problem is that standard table "Capacity Leger Entry" is from 2 objects: table "Capacity Ledger Entry" and tableextension "Mfg. Capacity Ledger Entry". Both are part of "Base Application". This is problem probably reason why we get warning about fields in keys. It is OK now, but runtime 18 will raise error and it will be problem.

2. To Reproduce
Steps to reproduce the behavior:

  1. Create Page with source table "Capacity Leger Entry"
  2. Set
sorting("Order No.", "Order Line No.", "Routing No.", "Routing Reference No.", "Operation No.", "Last Output Line");
  1. You will get warning AL0254
  2. Create table extension for "Capacity Leger Entry" and create key
key("Key1ISH"; "Routing No.") { }
  1. You will get warning``` ALAL code snippet that demonstrates the issue or a link to a code repository the developers can easily pull down to recreate the issue locally.

**Note:** Because the developers need to copy and paste the code snippet, including a code snippet as a media file (i.e. .gif) is not sufficient.

**3. Expected behavior**
Tables created in one application have to be taken as one table and doesn't matter if is in code created as one object or more. Compiler create one object co it have to be same for warnings.

**4. Actual behavior**
warnings take care about source code inside application and raise false positive warning.

**5. Versions:**

- AL Language: 17.0.2273547
- Visual Studio Code: 1.121.0
- Business Central: BC28 CU01
- List of Visual Studio Code extensions that you have installed:
- Operating System:
  * [x] Windows
  * [ ] Linux
  * [ ] MacOS

### Final Checklist

Please remember to do the following:

* [x] Search the issue repository to ensure you are reporting a new issue

* [x] Reproduce the issue after disabling all extensions except the AL Language extension

* [x] Simplify your code around the issue to better isolate the problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions