{"title":"Codeunit.Run(Integer [, var Record]) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/codeunit/codeunit-run-integer-table-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/codeunit/codeunit-run-integer-table-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/codeunit/codeunit-run-integer-table-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":"Loads and runs the unit of AL code you specify.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"Codeunit.Run(Integer [, var Record]) Method","slug":"codeunitruninteger-var-record-method","at":0,"chars":1304},{"level":2,"title":"Syntax","slug":"syntax","at":417,"chars":83},{"level":2,"title":"Parameters","slug":"parameters","at":500,"chars":437},{"level":2,"title":"Return Value","slug":"return-value","at":937,"chars":238},{"level":2,"title":"See Also","slug":"see-also","at":1175,"chars":129}],"text":"# Codeunit.Run(Integer [, var Record]) Method\n> Version: _Available or changed with runtime version 1.0._\nLoads and runs the unit of AL code you specify. To use this method, you can specify a table associated with the codeunit when you defined the codeunit properties. This allows you to pass a variable with the method. The transaction that the codeunit contains is always committed due to the Boolean return value.\n## Syntax\n```al\n[Ok := ]  Codeunit.Run(Number: Integer [, var Record: Record])\n```\n## Parameters\nNumber\nType: ../integer/integer-data-type\nAn integer data type that identifies the unit of AL code. If the codeunit you specify does not exist, a run-time error occurs. If you run the codeunit with a record from a table other than the one it is associated with, a run-time error occurs.\n*[Optional] Record*\nType: ../record/record-data-type\nThis optional parameter identifies a record. This parameter is a record data type.\n## Return Value\n*[Optional] Ok*\nType: ../boolean/boolean-data-type\ntrue if the operation was successful; otherwise false. If you omit this optional return value and the operation does not execute successfully, a runtime error will occur.\n## See Also\ncodeunit-data-type\nGetting started with AL<../../devenv-get-started>\nDeveloping extensions<../../devenv-dev-overview>"}