web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Changing Report Layout in a Events Subscriber Procedure

(0) ShareShare
ReportReport
Posted on by 85
Hi ,
I have an Event Subscriber that gets called for Drop Shipment function. Inside the event Subscriber I would like to change the layout of the standard Purchase order. The Report :: line is showing me an error. Can someone please take a look at it. The error says "end expected"
[EventSubscriber(ObjectType::Table, Database::"Purchase Line", 'OnValidateVariantCodeOnBeforeDropShipmentError', '', true, true)]
    local procedure dropShipProcedure()
    begin
        Report:: "Standard Purchase - Order" = './layout/DropshipPurchaseOrder.docx';
        Message('This is a drop shipment');
    end;
Regards.
I have the same question (0)
  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,161 Moderator on at

    If what you are trying to do is the execute the report you must use the report.execute or report.print commands.

    Please see this doc:

    docs.microsoft.com/.../reportinstance-execute-method

    The report = method will not be recognized i think.

  • Leo99 Profile Picture
    85 on at

    It won't let me execute during that event.

    The following AL methods are limited during write transactions because one or more tables will be locked:

    Form.RunModal is not allowed in write transactions.

    Codeunit.Run is allowed in write transactions only if the return value is not used. For example, 'OK := Codeunit.Run()' is not allowed.

    Report.RunModal is allowed in write transactions only if 'RequestForm = false'. For example, 'Report.RunModal(...,false)' is allowed.

    XmlPort.RunModal is allowed in write transactions only if 'RequestForm = false'. For example, 'XmlPort.RunModal(...,false)' is allowed.

    Use the commit method to save the changes before this call, or structure the code differently.

    Contact your application developer for further assistance.

    Thanks for the reply

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,965 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,125 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 961 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans