Skip to content
This repository was archived by the owner on Oct 19, 2026. It is now read-only.
This repository was archived by the owner on Oct 19, 2026. It is now read-only.

Event OnFetchReportLayoutByCode missing #30288

Closed as not planned
Closed as not planned

Description

@CyrilleJsmt

Why do you need this change?

Create event to modify the layout state before printing but after a runmodal with the new method (Report Layout List 2000000234)

Describe the request

In CU44, there's a "FetchReportLayoutByCode" function to modify the layout before printing but after a runmodal.
Use with the old "Custom Report Layout". I can call a custom report before launching a report.

    [EventSubscriber(ObjectType::Codeunit, Codeunit::ReportManagement, OnFetchReportLayoutByCode, '', false, false)]
    local procedure OnFetchReportLayoutByCode(ObjectId: Integer; LayoutCode: Text; var TargetStream: OutStream; var IsHandled: Boolean)
    var
        CustomReportLayout: Record "Custom Report Layout";
        TempBlobIn: codeunit "Temp Blob";
        TempInStream: InStream;
        lSingleInstance: Codeunit "NVW NaviWest SingleInstance";
    begin
        LayoutCode := lSingleInstance.GetLayout();
        if not CustomReportLayout.Get(LayoutCode) then
            LayoutCode := '';

        if LayoutCode <> '' then begin
            CustomReportLayout.GetLayoutBlob(TempBlobIn);
            TempBlobIn.CreateInStream(TempInStream);
            CopyStream(TargetStream, TempInStream);
            IsHandled := true;
        end;
    end;

With the new method (Report Layout List 2000000234), is it possible to create a "OnFetchReportLayoutByCode" event to modify the layout state before printing but after a runmodal ? I haven't found a solution.

Activity

  1. added theissue type on Jun 26, 2026
  2. added
    missing-infoThe issue misses information that prevents it from completion.
    on Jun 26, 2026
  3. github-actions commented on Jun 26, 2026

    @github-actions
    Contributor

    Hi CyrilleJsmt,

    Thank you for your extensibility request. To help us process it efficiently, please update the issue to include the required information.

    📚 Extensibility Guidelines

    Missing Information:

    • proposed_code_change: Provide the exact base code addition or modification with surrounding context showing where in the new report layout flow the event should be published.

    Please update the issue with the missing details. We'll automatically re-analyze once updated.

    Note

    Automatically generated by the Triage Agent — advisory only. An engineer will review before any action is taken.

    Tip

    Not accurate? Reply with /not-accurate (optional: add a short explanation). Your feedback improves future responses.

  4. CyrilleJsmt commented on Jul 7, 2026

    @CyrilleJsmt
    Author

    proposed_code_change: CU codeunit 2000000005 "Reporting Triggers"

    Image

    // After runmodal report and before printing, in option report, fetching a new layout Name by AL code.
    ///


    /// Business event that allows layout selection through a user interface, primarily used by the "Report Layouts" extension.
    ///

    /// The ID of the report object.
    /// The name of the selected layout.
    /// The GUID of the app that provides the layout.
    /// Indicates whether the layout selection was successful.
    ///
    /// This event enables UI-based layout selection and is primarily used by the first-party "Report Layouts" extension to provide a user-friendly layout selection experience.
    ///
    [BusinessEvent(false)]
    procedure FetchReportLayoutUI(ObjectId: Integer; var LayoutName: Text; var LayoutAppID: Guid; var Success: Boolean)
    begin
    end;

  5. added
    missing-infoThe issue misses information that prevents it from completion.
    and removed
    missing-infoThe issue misses information that prevents it from completion.
    on Jul 7, 2026
  6. github-actions commented on Jul 7, 2026

    @github-actions
    Contributor

    Hi CyrilleJsmt,

    Thank you for your extensibility request.

    A similar event already exists in this location that may serve your purpose:

    Existing event: OnAfterSelectReportLayoutUI

    [IntegrationEvent(false, false)]
    local procedure OnAfterSelectReportLayoutUI(ObjectID: Integer; var LayoutName: Text; var LayoutAppID: Guid; Success: Boolean)
    begin
    end;

    Location: ReportManagement.Codeunit.al

    Would this existing event work for your scenario? If not, please explain why a new event is needed.

    Please respond with confirmation or additional details. We'll re-analyze once you respond.

    Note

    Automatically generated by the Triage Agent — advisory only. An engineer will review before any action is taken.

    Tip

    Not accurate? Reply with /not-accurate (optional: add a short explanation). Your feedback improves future responses.

  7. CyrilleJsmt commented on Jul 10, 2026

    @CyrilleJsmt
    Author

    The Event OnAfterSelectReportLayoutUI must be call BEFORE a RUNMODAL report. Whereas I want to modify my layout AFTER the runmodal. With the old "Custom Report Layout" method, the OnFetchReportLayoutByCode event handled this very well !

    I need a FetchReportLayoutUI event that works with the new "Report Layout List" method, as I explained just above.

    Since you do not understand my request, I will phrase it more simply: how do I modify a report's layout using AL code once the report has been launched ?

    Image
  8. removed
    missing-infoThe issue misses information that prevents it from completion.
    on Jul 10, 2026
  9. github-actions commented on Jul 10, 2026

    @github-actions
    Contributor

    Hi CyrilleJsmt,

    Thank you for your extensibility request. To help us process it efficiently, please update the issue to include the required information.

    📚 Extensibility Guidelines

    Missing Information:

    • proposed_code_change: Provide the exact base code addition or modification with searchable surrounding context showing where the new event should be published in the new report layout flow.

    Please update the issue with the missing details. We'll automatically re-analyze once updated.

    Note

    Automatically generated by the Triage Agent — advisory only. An engineer will review before any action is taken.

    Tip

    Not accurate? Reply with /not-accurate (optional: add a short explanation). Your feedback improves future responses.

  10. added
    missing-infoThe issue misses information that prevents it from completion.
    on Jul 10, 2026
  11. CyrilleJsmt commented on Aug 3, 2026

    @CyrilleJsmt
    Author

    proposed_code_change: CU codeunit 2000000005 "Reporting Triggers"

    Image

    // After runmodal report and before printing, in option report, fetching a new layout Name by AL code.
    ///


    /// Business event that allows layout selection through a user interface, primarily used by the "Report Layouts" extension.
    ///

    /// The ID of the report object.
    /// The name of the selected layout.
    /// The GUID of the app that provides the layout.
    /// Indicates whether the layout selection was successful.
    ///
    /// This event enables UI-based layout selection and is primarily used by the first-party "Report Layouts" extension to provide a user-friendly layout selection experience.
    ///
    [BusinessEvent(false)]
    procedure FetchReportLayoutUI(ObjectId: Integer; var LayoutName: Text; var LayoutAppID: Guid; var Success: Boolean)
    begin
    end;

  12. added
    missing-infoThe issue misses information that prevents it from completion.
    and removed
    missing-infoThe issue misses information that prevents it from completion.
    on Aug 3, 2026
  13. github-actions commented on Aug 3, 2026

    @github-actions
    Contributor

    Hi CyrilleJsmt,

    Thank you for your extensibility request. To help us process it efficiently, please update the issue to include the required information.

    📚 Extensibility Guidelines

    Missing Information:

    • proposed_code_change: Provide the exact base code addition or modification with searchable surrounding context showing precisely where in codeunit 2000000005 "Reporting Triggers" the new event should be published in the new report layout flow.

    Please update the issue with the missing details. We'll automatically re-analyze once updated.

    Note

    Automatically generated by the Triage Agent — advisory only. An engineer will review before any action is taken.

    Tip

    Not accurate? Reply with /not-accurate (optional: add a short explanation). Your feedback improves future responses.

  14. CyrilleJsmt commented on Aug 27, 2026

    @CyrilleJsmt
    Author

    /not-accurate I've already suggested a code

  15. github-actions commented on Aug 27, 2026

    @github-actions
    Contributor

    ✅ Feedback recorded
    Thanks — your /not-accurate feedback has been logged and will be reviewed.

  16. AleksandricMarko commented on Oct 12, 2026

    @AleksandricMarko
    Contributor

    Hello CyrilleJsmt,

    Would it be suitable for your scenario if we add a new event,  OnAfterGetSelectedReportLayout , in the  SelectReportLayoutCode  procedure of codeunit 44  Report Management ?

    The event would be called after the current layout has been resolved but before it is returned to the reporting runtime:

    SelectedLayoutName := DesignTimeReportSelection.GetSelectedLayout();
    SelectedAppID := DesignTimeReportSelection.GetSelectedAppID();
    
    if SelectedLayoutName = '' then
        if ReportLayoutSelection.Get(ObjectId, CompanyName) and
           (ReportLayoutSelection.Type = ReportLayoutSelection.Type::"Custom Layout")
        then
            SelectedLayoutName := ReportLayoutSelection."Custom Report Layout Code";
    
    OnAfterGetSelectedReportLayout(ObjectId, SelectedLayoutName, SelectedAppID);
    
    if (SelectedLayoutName <> '') and
       (StrLen(SelectedLayoutName) <= MaxStrLen(CustomReportLayout."Code"))
    then
        ...

    The new event would be:

    [IntegrationEvent(false, false)]
    local procedure OnAfterGetSelectedReportLayout(
        ObjectId: Integer;
        var LayoutName: Text[250];
        var LayoutAppID: Guid)
    begin
    end;

    This would allow subscribers to replace both the layout name and its application ID during late layout resolution and would support layouts from the new  Report Layout List  flow.

  17. AleksandricMarko commented on Oct 16, 2026

    @AleksandricMarko
    Contributor

    As this repo will be archived in few days, I will close the issue. In case you still need proper event request, please create new issue as part of BCApps repo (https://github.com/microsoft/BCApps/issues)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    missing-infoThe issue misses information that prevents it from completion.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions