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

Community site session details

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

API-triggered Report fails with "Sorry, we just updated this page" error

(3) ShareShare
ReportReport
Posted on by 24
Hi,
I'm encountering a strange issue in our Business Central environment when triggering a report via the TaskScheduler from an API session.
 
Scenario:
An API call creates a queue entry and subsequently triggers a TaskScheduler task:
 
  • This task executes a report using the following code:
 
Problem:
If the API Session with the Entra Application User (AAD Application) create the Task, the Report fails with the Error Message:
Sorry, we just updated this page. Reopen it, and try again.

However, when I manually trigger the same process using my user account, everything works fine and the report is generated successfully.

Additional Info:
Rec in Picture 1 is CurrentSyncQueueEntry in Picture 2

Has anyone experienced similar behavior with TaskScheduler and API sessions?
Could this be related to session context, permissions, or report rendering limitations in background tasks?
I have the same question (0)
  • Verified answer
    DAnny3211 Profile Picture
    11,376 on at
    API-triggered Report fails with "Sorry, we just updated this page" error

    Hello,

    Thank you for sharing the details of your scenario.

    The issue where a report fails with the message:

    "Sorry, we just updated this page. Reopen it, and try again."

    when triggered via an API session using an Entra Application User (AAD Application), but works correctly when executed manually by a user, may be related to how session context, permissions, or UI rendering is handled in background tasks initiated through the Task Scheduler.

    Possible Causes and Recommendations:

    1. Session Context Limitations
      API sessions initiated by application users often lack the full interactive session context required for certain UI-bound operations, such as report rendering. If the report relies on session-specific data (e.g., user settings, personalization, or temporary tables), it may fail when executed in a non-interactive context.

    2. Missing Permissions or Role Assignments
      Ensure that the Entra Application User has all necessary permissions and role assignments to execute the report and access the required data. This includes:

      • Permission to run the report object.
      • Access to any data sources or tables used in the report.
      • Permission to execute background tasks if applicable.
    3. Report Rendering Constraints
      Some reports are designed to be rendered only in interactive sessions (e.g., with a UI client). If the report includes UI elements or logic that depends on a client session, it may not function correctly when triggered via background API calls.

    4. Use of Task Scheduler
      If the report is being executed via the Task Scheduler, verify that the task is configured to run in a context that supports report rendering. Consider testing the report execution using a background session initiated by a standard user to compare behavior.

    5. Alternative Execution Strategy
      If the report must be executed programmatically, consider:

      • Using a report extension to decouple UI logic from data processing.
      • Exporting the report data to a file (e.g., Excel, PDF) using AL code and delivering it via email or storage.
    6. Logging and Diagnostics
      Enable detailed logging or use the Event Viewer and AL debugger to capture any exceptions or missing context during the report execution.

    If this guidance helps resolve the issue, please consider marking the response as accepted so it may assist others encountering similar challenges.

    Best regards.

  • Philipp1804 Profile Picture
    24 on at
    API-triggered Report fails with "Sorry, we just updated this page" error
    Thanks for your response.
    I've already checked the permissions, and everything seems ok. Since the report works fine when executed in a user session, I’ll try using the job queue as a workaround and process the entries at regular intervals.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 4,202

#2
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 3,248

#3
Sumit Singh Profile Picture

Sumit Singh 2,893

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans