topic hubAL Developmentofficial - Microsoftunreviewed - model text not yet checked

Modifying data

Modifying data in AL covers the methods and table types used to change and work with records: Insert, Modify, Delete, temporary and virtual tables, filter pages, media on records, Dataverse table properties, and keeping test data between extension publishes. It answers how-to and syntax questions for these tasks.

Path: Development > Programming in the AL language > Tables and data > Modifying data · tier official · system development · narrative unreviewed (model text not yet checked)

Overview

This section groups AL pages about writing and shaping data in Business Central tables. The core page documents the Insert, Modify, ModifyAll, Delete, DeleteAll and Truncate methods, including syntax, return values and when Truncate is preferable to DeleteAll for bulk deletion.

Several pages describe special kinds of tables. Temporary tables are in-memory tables that reduce network and database load. Virtual tables are read-only and computed at runtime, with the Date and Integer virtual tables covered in their own pages. Other pages cover runtime filter pages built with FilterPageBuilder, media on records, enabling Dataverse tables for extension development, and retaining test data between publishes.

Start with the Insert, Modify and Delete page for the basic data operations. Then pick the page that matches your scenario, such as temporary tables for in-memory processing or the Date and Integer tables for reports and loops.

Key points

  • Insert, Modify, ModifyAll, Delete, DeleteAll and Truncate are the AL methods for maintaining data. Truncate is the high-performance option for bulk deletion compared with DeleteAll.
  • Temporary tables are in-memory tables. You can create them with the TableType property, temporary record variables, or the SourceTableTemporary page property.
  • Virtual tables are read-only, computed at runtime and not stored in the database. They expose integers, dates, OS files, disk drives and database storage information.
  • The Date virtual table (ID 2000000007) has fields for period type, start, end, number and name. It is used to filter and obtain date ranges for pages and reports.
  • The Integer virtual table (ID 2000000026) holds integers from -1,000,000,000 to 1,000,000,000. It is filtered to control loops in reports.
  • FilterPageBuilder creates runtime filter pages that set filters on multiple tables in a modal dialog. You add tables with the addtable method and records with the addrecord method.
  • Media on records can be stored with the BLOB, Media or MediaSet data types. It can be shown in list pages with a tile layout, in card pages and in reports.
  • The schemaUpdateMode setting in launch.json (Synchronize, Recreate, ForceSync) controls whether sample data is kept between extension publishes.

Learn pages

Videos, posts and code changes

Linked by a Haiku matcher with a grounding quote from the item’s summary (link/topics.ts); machine-generated.

Source: Microsoft Learn (CC BY 4.0). Descriptions are Learn’s own.

What Learn documents here 8 of 9 Learn pages

Show 1 more