code change · featureAL Developmentofficial - Microsoftreviewed - checked by Opus

#152 knowledge(events): ChangeCompany leaves triggers and trigger-event subscribers running in the calling company

A knowledge article documents that ChangeCompany does not move trigger execution context to the target company; triggers and trigger-event subscribers still run in the calling company. StartSession is recommended for cross-company operations that require proper trigger handling.

Pull request · merged into main on 2026-09-15 by waldo1001 · 4 files (+219 -1), 4 AL · feature · tier official · reviewed (checked by Opus)

What changed

  • ChangeCompany redirects only the data access of a record variable
  • Triggers, field validation and database trigger-event subscribers keep running in the calling company
  • Passing RunTrigger false skips trigger code, but subscribers still receive the trigger events
  • The recommended approach is StartSession with the company parameter, so the code runs in the target company
  • Direct cross-company writes should be limited to trigger-free hand-off tables owned by the extension

AL objects touched

  • microsoft/knowledge/events/changecompany-runs-triggers-in-the-calling-company.bad.al: added, not in the BC? snapshot yet
  • microsoft/knowledge/events/changecompany-runs-triggers-in-the-calling-company.good.al: added, not in the BC? snapshot yet
  • microsoft/knowledge/events/changecompany-runs-triggers-in-the-calling-company.md: added, not in the BC? snapshot yet
  • microsoft/skills/review/al-events-review.md: modified, not in the BC? snapshot

Context

  • Systems: 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).