AL icon indicating copy to clipboard operation
AL copied to clipboard

RunPageView and SubPageView `where` suggests fields from wrong (parent) table

Open dzzzb opened this issue 3 years ago • 1 comments

reopening https://github.com/microsoft/AL/issues/6339

Describe the bug RunPageView and SubPageView's where clause suggests fields from the table of the parent page when pressing Ctrl+Space or otherwise invoking the Intellisense auto-complete list. This is obviously wrong, since the page being run probably shows a different child table, and we are filtering its fields, not those of the calling parent page. Thus Intellisense suggests wrong fields, and ones that will give syntax errors once accepted...

To Reproduce Just have an action or part that use RunPageView or SubPageView respectively, and try creating the where clause and using Ctrl+Space to suggest fields within its ().

pageextension 50100 Test extends "Vendor List"
{
    actions
    {
        addlast(navigation)
        {
            action(Payments)
            {
                ApplicationArea = All;
                Caption = 'Payments';
                RunObject = Page "Vendor Ledger Entries";
                RunPageLink = "Vendor No." = field("No.");
                RunPageView=where() // <- Ctrl+Space in here
            }
        }
    }
}

Expected behavior Suggest fields from the child table to be shown by the triggered page/subpage, not parent.

Screenshots This shows a list page build on the Vendor table, trying to add an action to show Vendor Ledger Entries of type Payment for the current vendor, and getting suggested to filter on fields from the parent Vendor, when they are actually applied to the child Ledger Entry. image

5. Versions:

Name: AL Language
Id: ms-dynamics-smb.al
Description: AL development tools for Dynamics 365 Business Central
Version: 8.3.570094
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-dynamics-smb.al

dzzzb avatar Feb 03 '22 09:02 dzzzb

You are right. Makes RunpageView "where expressions" quite useless. Looks like it is not the most used property though, since I guess this bug has been there since its original implementation. Nevertheless we should fix this asap.

kalberes avatar Feb 05 '22 09:02 kalberes

The fix for this issue has been checked in to the master branch. It will be available in the bcinsider.azurecr.io/bcsandbox-master Docker image starting from platform build number 23.0.11843.0 and VS Code Extension Version 12.0.850504.

If you don’t have access to these images you need to become part of the Ready2Go program: aka.ms/readytogo

For more details on code branches and docker images please read: https://blogs.msdn.microsoft.com/nav/2018/05/03/al-developer-previews-multiple-releases-and-github/ https://freddysblog.com/2020/06/25/working-with-artifacts/

JesperSchulz avatar Aug 22 '23 06:08 JesperSchulz