{"title":"Record.ModifyAll(Any, Any [, Boolean]) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/record/record-modifyall-method/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/record/record-modifyall-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/record/record-modifyall-method","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Modifies a field in all records within a range that you specify.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"Record.ModifyAll(Any, Any [, Boolean]) Method","slug":"recordmodifyallany-any-boolean-method","at":0,"chars":2047},{"level":2,"title":"Syntax","slug":"syntax","at":173,"chars":89},{"level":2,"title":"Parameters","slug":"parameters","at":262,"chars":535},{"level":2,"title":"Remarks","slug":"remarks","at":797,"chars":683},{"level":2,"title":"Example","slug":"example","at":1480,"chars":350},{"level":2,"title":"Related information","slug":"related-information","at":1830,"chars":217}],"text":"# Record.ModifyAll(Any, Any [, Boolean]) Method\n> Version: _Available or changed with runtime version 1.0._\nModifies a field in all records within a range that you specify.\n## Syntax\n```al\n Record.ModifyAll(Field: Any, NewValue: Any [, RunTrigger: Boolean])\n```\n## Parameters\nRecord\nType: record-data-type\nAn instance of the record-data-type data type.\nField\nType: ../any/any-data-type\nThe field that you want to modify.\nNewValue\nType: ../any/any-data-type\nThe value that you want to assign to Field in all records. The data type of NewValue must match the data type of Field.\n*[Optional] RunTrigger*\nType: ../boolean/boolean-data-type\nIf this parameter is true, the code in the OnModify Trigger is executed. If this parameter is false (default), the code in the OnModify trigger is not executed.\n## Remarks\n> IMPORTANT\n> By design, the global variables of the record instance being modified will be initialized to their default value during the ModifyAll method execution, independently of the value that was previously set.\nIf no filter is set, the field is modified in all records in the table. If a filter is set, the fields are modified only in the records which fall within the range specified by the filter. Records where the field is already equal to the new value are also updated.\nThe OnValidate field trigger is never run when ModifyAll is used. Using ModifyAll() is recommended if field validation is not wanted or needed. Otherwise, record-modify-method can be used.\n## Example\n```al\nvar\n    customerRec: record Customer;\n\nbegin\n    // The result of this statement:\n    customerRec.ModifyAll(\"Statistics Group\", 2);\n    // is equivalent to:\n    if customerRec.Find('-') then\n        repeat\n            customerRec.\"Statistics Group\" := 2;\n            customerRec.Modify;\n        until customerRec.Next = 0;\nend;\n\n```\n## Related information\nrecord-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>\n../../../administration/optimize-sql-al-database-methods-and-performance-on-server"}