{"title":"Record.Mark([Boolean]) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/record/record-mark-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-mark-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-mark-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":"Marks a record.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"Record.Mark([Boolean]) Method","slug":"recordmarkboolean-method","at":0,"chars":2752},{"level":2,"title":"Syntax","slug":"syntax","at":178,"chars":63},{"level":2,"title":"Parameters","slug":"parameters","at":241,"chars":177},{"level":2,"title":"Return Value","slug":"return-value","at":418,"chars":119},{"level":2,"title":"Remarks","slug":"remarks","at":537,"chars":392},{"level":2,"title":"Example 1","slug":"example-1","at":929,"chars":911},{"level":2,"title":"Example 2","slug":"example-2","at":1840,"chars":778},{"level":2,"title":"Related information","slug":"related-information","at":2618,"chars":134}],"text":"# Record.Mark([Boolean]) Method\n> Version: _Available or changed with runtime version 1.0._\nMarks a record. You can also use this method to determine whether a record is marked.\n## Syntax\n```al\n[Marked := ]  Record.Mark([Mark: Boolean])\n```\n## Parameters\nRecord\nType: record-data-type\nAn instance of the record-data-type data type.\n*[Optional] Mark*\nType: ../boolean/boolean-data-type\nSpecifies if a record is marked.\n## Return Value\n*[Optional] Marked*\nType: ../boolean/boolean-data-type\ntrue if the record is marked; otherwise, false.\n## Remarks\nThe mark on a record is temporary, and disappears when the current session ends. The Mark method is valid for the specific record instance/variable, and not shared between all variables of the same record type in a session.\nYou can use the record-markedonly-method to activate a special filter where your view of the table includes only records marked by the Mark (Record) method.\n## Example 1\nThis example shows how to use the Mark method, assuming that no records are marked initially. The example loops through the customer records and marks a specific record. The message dialog displays the records one by one with information about whether the record is marked or not.\n```al\ncodeunit 50121 MarkedRecord\n{\n    trigger OnRun()\n    var\n        Customer: Record Customer;\n        Marked: Boolean;\n        Text000: Text;\n    begin\n        Text000 := 'Customer.\"No.\" %1, Marked?: %2';\n\n        Customer.SetCurrentKey(\"No.\");\n        Customer.\"No.\" := '10000';\n        Customer.Find('=');\n        Customer.Mark(true); // Mark a record.\n        Customer.Find('-'); // Find first record.\n        repeat // Go through records\n            Marked := Customer.Mark; // Test if marked.\n            Message(Text000, Customer.\"No.\", Marked);\n        until\n            Customer.Next = 0;\n    end;\n}\n```\n## Example 2\nThis next example shows how to use the Mark method together with the MarkedOnly method, assuming that no records are marked initially.\n```al\ncodeunit 50121 MarkedOnlyRecord\n{\n    trigger OnRun()\n    var\n        Customer: Record Customer;\n        No1: Integer;\n        No2: Integer;\n        Text001: Text;\n        Text002: Text;\n    begin\n        Text001 := 'Number of records before MarkedOnly: %1\\';\n        Text002 := 'Number of records after MarkedOnly: %2';\n\n        Customer.SetCurrentKey(Customer.\"No.\");\n        Customer.\"No.\" := '10000';\n        Customer.Find('=');\n        Customer.Mark(true);\n        No1 := Customer.Count();\n        Customer.MarkedOnly(true);\n        No2 := Customer.Count();\n        Message(Text001 + Text002, No1, No2);\n    end;\n}\n```\n## Related information\nrecord-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}