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

[BUG] Convert page control tooltip to table control tooltip does not work for non-Rec variables. #7949

Open
4 of 6 tasks
fvet opened this issue Jan 16, 2025 · 1 comment
Open
4 of 6 tasks
Labels

Comments

@fvet
Copy link

fvet commented Jan 16, 2025

Please include the following with each issue:

1. Describe the bug
When a page contains various page controls with a tooltip, the Code Action 'Convert page control tooltip to table control tooltip' is shown to move the tooltips to the table level.

For page controls with a Rec.Field as SourceExpression, the tooltip is moved to the table and the tooltip is rendered correct in the webclient.
For page controls with a OtherRecordVariable.Field as SourceExpression, the tooltip is moved to the table (?) and the tooltip is no longer rendered correct in the webclient.

2. To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'

Create a simple table without tooltips

table 50100 "My Table"
{
    Caption = 'My Table';
    DataClassification = ToBeClassified;

    fields
    {
        field(1; "My Field"; Integer)
        {
            Caption = 'My Field';
        }
    }
    keys
    {
        key(PK; "My Field")
        {
            Clustered = true;
        }
    }
}

Create a simple page with 2 page fields and tooltips.

  • One page field referencing a field by Rec.
  • One page field referencing a field using a global record variable.
namespace ALProject.ALProject;

page 50100 "My Table List"
{
    ApplicationArea = All;
    Caption = 'My Table List';
    PageType = List;
    SourceTable = "My Table";
    UsageCategory = Lists;

    layout
    {
        area(Content)
        {
            repeater(General)
            {
                field("My Field"; Rec."My Field")
                {
                    ToolTip = 'Tooltip of my field';
                }
                field("My Field 2"; MyTable."My Field")
                {
                    ToolTip = 'Tooltip of my field';
                }
            }
        }
    }

    var
        MyTable: Record "My Table";
}

Publish the project.
Open the list page in the webclient.
Check the tooltip for My Field (OK) and My Field 2 (OK)


Now use the Code Action to 'Convert page control tooltip to table control tooltip'

Image

Result: Tooltip is moved to table.

table 50100 "My Table"
{
    Caption = 'My Table';
    DataClassification = ToBeClassified;

    fields
    {
        field(1; "My Field"; Integer)
        {
            Caption = 'My Field';
            ToolTip = 'Tooltip of my field';  // Tooltip moved to table level
        }
    }
    keys
    {
        key(PK; "My Field")
        {
            Clustered = true;
        }
    }
}

Tooltips are removed from page controls.

page 50100 "My Table List"
{
    ApplicationArea = All;
    Caption = 'My Table List';
    PageType = List;
    SourceTable = "My Table";
    UsageCategory = Lists;

    layout
    {
        area(Content)
        {
            repeater(General)
            {
                field("My Field"; Rec."My Field")
                {
// Tooltip moved to table level
                }
                field("My Field 2"; MyTable."My Field")
                {
// Tooltip moved to table level
                }
            }
        }
    }

    var
        MyTable: Record "My Table";
}

Publish the project.
Open the list page in the webclient.
Check the tooltip for My Field (OK) and My Field 2 (NOK)
Tooltip for My Field 2 is no longer shown.

Image

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

2 solutions are possible:

  • Either by the AL team : The code action 'Convert page control tooltip to table control tooltip' should NOT move tooltips from page controls based on a global variable, other than Rec. This will prevent loss of tooltips for the MyTable."My Field" case.
  • Either by the Webclient team : The webclient should retrieve the tooltip for page fields referencing another variable than Rec., from the underlying table of the global var. For the MyTable."My Field" case, the tooltip should be retrieved from table 'My Table', field 'My Field'.

4. Actual behavior
See 2.

5. Versions:

  • AL Language: 14.2.1249978
  • Visual Studio Code:
  • Business Central: BC 24 (runtime 13.1)
  • List of Visual Studio Code extensions that you have installed:
  • Operating System:
    • Windows
    • Linux
    • MacOS

Final Checklist

Please remember to do the following:

  • Search the issue repository to ensure you are reporting a new issue

  • Reproduce the issue after disabling all extensions except the AL Language extension

  • Simplify your code around the issue to better isolate the problem

Internal work item: AB#562665

@BazookaMusic
Copy link
Contributor

Very nice and detailed bug report. As you mentioned either the runtime needs to propagate the caption or the code actions should only work on Rec fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants