{"title":"RecordRef.Get(RecordId) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/recordref/recordref-get-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/recordref/recordref-get-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/recordref/recordref-get-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":"Gets a record based on the ID of the record.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"RecordRef.Get(RecordId) Method","slug":"recordrefgetrecordid-method","at":0,"chars":1890},{"level":2,"title":"Syntax","slug":"syntax","at":138,"chars":64},{"level":2,"title":"Parameters","slug":"parameters","at":202,"chars":280},{"level":2,"title":"Return Value","slug":"return-value","at":482,"chars":238},{"level":2,"title":"Remarks","slug":"remarks","at":720,"chars":277},{"level":2,"title":"Example","slug":"example","at":997,"chars":756},{"level":2,"title":"Related information","slug":"related-information","at":1753,"chars":137}],"text":"# RecordRef.Get(RecordId) Method\n> Version: _Available or changed with runtime version 1.0._\nGets a record based on the ID of the record.\n## Syntax\n```al\n[Ok := ]  RecordRef.Get(RecordID: RecordId)\n```\n## Parameters\nRecordRef\nType: recordref-data-type\nAn instance of the recordref-data-type data type.\nRecordID\nType: ../recordid/recordid-data-type\nThe RecordID that contains the table number and the primary key of the table and is used to identify the record that you want to get.\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## Remarks\nThis method always uses the primary key for the table. It ignores any filters that are set, except security filters. Security filters are applied or ignored based on the Security Filter Mode. The current key and filters are not changed after you call this method. .\n## Example\nThe following example opens the Customer table with the RecordRef variable, RecRef. The code assigns the first field in the table, which is the No. field, to MyFieldRef variable. The variable is assigned a value of 30000 by using the recordref-field-method. The recordref-recordid-method retrieves the record ID of the record that has a value of 30000 in the No. field. The Get method then uses the RecID variable then to retrieves the record.\n```al\nvar\n    RecRef: RecordRef;\n    MyFieldRef: FieldRef;\n    RecID: RecordId;\nbegin\n    RecRef.Open(Database::Customer);\n    MyFieldRef := RecRef.Field(1);\n    MyFieldRef.Value := '30000';\n    if RecRef.Find('=') then begin\n      RecID := RecRef.RecordId;\n      RecRef.Get(RecID);\n    end;\nend;\n```\n## Related information\nrecordref-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}