bcquality/microsoft/knowledge/performance/use-insert-false-when-skipping-triggers.md
Jesper Schulz-Wedde 0540c7bf6e Reframe seed-article banners as community contribution invitations
The 35 articles still in their seed form previously carried a banner
reading "Seed article. ... Domain stewards should expand, restructure,
and refine as needed." For a community preview, that phrasing reads as
"TODO left in production" to first-time visitors.

Replace all three banner variants (performance-seeded, security-seeded,
community-ported) with a single positive invitation:

> Contributions welcome — open a PR to refine or extend this article.

Content and structure of the articles are unchanged; only the leading
quote block differs. Articles that had their banner fully stripped in
the earlier triage pass (the showcase-grade ten) are unaffected.
2026-04-23 17:31:36 +02:00

1.3 KiB

bc-version domain keywords technologies countries application-area
all
performance
insert
modify
delete
triggers
parameters
al
w1
all

Choose Insert, Modify, and Delete parameters deliberately

Contributions welcome — open a PR to refine or extend this article.

Description

Insert, Modify, and Delete accept a boolean that controls whether the table's OnInsert / OnModify / OnDelete trigger fires. Running the trigger for scratch or migrated data is often unnecessary work — side effects, posting rules, validations — for rows that were already validated upstream. Running the trigger when application logic depends on it is non-negotiable.

Best Practice

Call Insert(true), Modify(true), or Delete(true) when the table's trigger logic is part of the operation's semantics. Call Insert(false), Modify(false), or Delete(false) when the operation is bulk data movement or temporary-table manipulation and the trigger would duplicate work or fire invalid side effects.

See sample: use-insert-false-when-skipping-triggers.good.al.

Anti Pattern

Blindly passing true everywhere pays for triggers on rows that do not need them. Blindly passing false silently skips validations that the table's author intended to be mandatory.