Skip to content
Arthur van de Vondervoort edited this page Jul 24, 2024 · 9 revisions

Explicitly set the RunTrigger parameter on build-in methods.

This rule analyzes the build-in methods, where the RunTrigger parameter is optional.

Method Documentation
Insert Record.Insert([Boolean], [Boolean])
Modify Record.Modify([Boolean])
ModifyAll Record.ModifyAll(Any, Any [, Boolean])
Delete Record.Delete([Boolean])
DeleteAll Record.DeleteAll([Boolean])

All of these methods can be invoked without explicitly specifying the RunTrigger parameter, which defaults to false. However, relying on this implicit usage can present challenges for maintenance, potentially compromising the code's clarity and intent.

Clarity
Being explicit is better than being implicit. When setting explicit the value to false, the intention is clear to not to run the trigger.

Avoid ambiguity
Record.Modify() could mean two things: You either don’t want to run the trigger, or you forgot to run it.

Maintainability
Without the RunTrigger parameter, another developer might assume you made a mistake and try to fix it by running the RunTrigger, which could introduce bugs.

External references

Clone this wiki locally