Skip to content

Cannot debug OnOpenPage and OnInit of Report's request page #8171

@mjmatthiesen

Description

@mjmatthiesen

Please include the following with each issue:

1. Describe the bug
When setting a breakpoint within the onopenpage trigger it will never stop and be caught, even though the code is executing.

2. To Reproduce
Steps to reproduce the behavior:

  1. Create a new report.
  2. Add the request page area.
  3. Add an OnOpenPage and OnInit trigger.
  4. Add an OnInitReport trigger (global).
  5. Add simple code in each.
  6. Add a breakpoint.
  7. Deploy and debug.
  8. Don't hit breakpoints.
  9. OnInitReport will be hit, but has about a 25% chance to crash the debugger, more common with actual complex reports.
report 50100 "Example Report"
{
    Caption = 'Example';
    ApplicationArea = All;
    UsageCategory = ReportsAndAnalysis;

    requestpage
    {
        trigger OnInit()
        begin
            // cannot debug
            Message('trigger OnInit');
        end;
        trigger OnOpenPage()
        begin
            // cannot debug
            Message('trigger OnOpenPage');
        end;
    }

    trigger OnInitReport()
    begin
        // often, not always, crashes the debugger
        Message('trigger OnInitReport');
    end;
}

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
Break to allow debugging and do not crash debugger.

4. Actual behavior
Doesn't break or debugger stops leading to "debugger stopped the current action" message within BC.

5. Versions:

  • AL Language: 16.2.1869542
  • Visual Studio Code: 1.106.3 (system setup)
  • Business Central: 26.0 and 27.0, probably more.
  • List of Visual Studio Code extensions that you have installed: AL Language.
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions