code change · featurePlatform, DevOps & Performanceofficial - Microsoftreviewed - checked by Opus

#161 AL methods limited during write transactions (RunModal, Codeunit.Run)

New performance guidance documents platform restrictions on calling RunModal and Codeunit.Run methods during write transactions, explaining when each method is blocked and how to structure code to avoid triggering the runtime error.

Pull request · merged into main on 2026-09-29 by MichaelDieringer · 5 files (+85 -2), 5 AL · feature · tier official · reviewed (checked by Opus)

What changed

  • Page.RunModal is never allowed in a write transaction; Report and XmlPort.RunModal only when the request page is suppressed
  • Codeunit.Run is allowed only when its return value is unused
  • ‘Modal page’ removed from the user-prompts article because that case fails with a runtime error rather than stalling
  • Recommended structure follows Base Application’s Commit() before Page.RunModal pattern
  • Performance review skill gains RunModal and UseRequestPage cues and routes Codeunit.Run to its existing article

AL objects touched

  • microsoft/knowledge/performance/al-methods-limited-during-write-transactions.bad.al: added, not in the BC? snapshot yet
  • microsoft/knowledge/performance/al-methods-limited-during-write-transactions.good.al: added, not in the BC? snapshot yet
  • microsoft/knowledge/performance/al-methods-limited-during-write-transactions.md: added, not in the BC? snapshot yet
  • microsoft/knowledge/performance/avoid-user-prompts-inside-transactions.md: modified, not in the BC? snapshot
  • microsoft/skills/review/al-performance-review.md: modified, not in the BC? snapshot

Context

  • Systems: platform, development

Source: metadata of a merged pull request in microsoft/BCQuality (bcquality): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).