Wednesday, January 1, 2025

Understanding Modify(true) and Modify() in AL: When to Use Them and What to Watch Out For

Hello Everyone, 

During a recent Business Central project, I encountered a serious issue when modifying bulk records using Modify(True). The system froze, causing performance bottlenecks and making the process unusable. After troubleshooting, I realized that improper use of Modify(True) was the root cause.

What Are Modify(True) and Modify?

  • Modify: Saves changes to the database without triggering the OnModify trigger.
  • Modify(True): Saves changes and triggers the OnModify trigger, executing any additional logic defined in the table.