{"title":"ReadByRecId Operation","url":"https://jonas-paprotka.de/docs/dev-itpro/webservices/readbyrecid-operation/","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/webservices/readbyrecid-operation, 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/webservices/readbyrecid-operation","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","date":"2021-04-01","meta":{"topic":"article"},"outline":[{"level":2,"title":"Method Signature","slug":"method-signature","at":54,"chars":64},{"level":2,"title":"Parameters","slug":"parameters","at":118,"chars":119},{"level":2,"title":"Results","slug":"results","at":237,"chars":260},{"level":2,"title":"Faults","slug":"faults","at":497,"chars":294},{"level":2,"title":"Usage Example","slug":"usage-example","at":791,"chars":234},{"level":2,"title":"Related information","slug":"related-information","at":1025,"chars":44}],"text":"Reads the record that is identified by the record ID.\n## Method Signature\n`Entity ReadByRecId(string formattedRecId)`\n## Parameters\nParameter|Description\nformattedRecId|Type: String<br /><br /> The RecId that is used to read the record.\n## Results\nResult name|Description\nentity|Type: Entity<br /><br /> A variable of a specific object type that represents the page. Contains the latest values that are present on the page.<br /><br /> If the record is not found, then the operation returns null.\n## Faults\nThis operation does not return a fault when a matching record is not present. Instead, it returns null. In C\\#, you should test whether the result is a null reference. Otherwise, you may get a NullReferenceException exception.Faults are possible if they are generated by the AL code.\n## Usage Example\n```c#\npublic void ReadById(String id)\n{\n  Customer_Service service = new Customer_Service();\n  Customer cust = new Customer();\n  service.UseDefaultCredentials = true;\n  cust = service.ReadByRecId(id.ToUpper());\n}\n```\n## Related information\nbasic-page-operations"}