{"title":"OnAfterGetRecord (Report Data Item) trigger","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/triggers-auto/reportdataitem/devenv-onaftergetrecord-reportdataitem-trigger/","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/triggers-auto/reportdataitem/devenv-onaftergetrecord-reportdataitem-trigger, 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/triggers-auto/reportdataitem/devenv-onaftergetrecord-reportdataitem-trigger","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":"Runs each time a record is retrieved from the data item.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"OnAfterGetRecord (Report Data Item) trigger","slug":"onaftergetrecord-report-data-item-trigger","at":0,"chars":2153},{"level":2,"title":"Syntax","slug":"syntax","at":163,"chars":66},{"level":2,"title":"Remarks","slug":"remarks","at":229,"chars":1302},{"level":2,"title":"Related information","slug":"related-information","at":1531,"chars":622}],"text":"# OnAfterGetRecord (Report Data Item) trigger\n> Version: _Available or changed with runtime version 1.0._\nRuns each time a record is retrieved from the data item.\n## Syntax\n```al\ntrigger OnAfterGetRecord()\nbegin\n    ...\nend;\n```\n## Remarks\nUse this trigger to perform any processing that is needed, based on the values in the fields of the individual records of a data item.\nIf the record contains ../../devenv-flowfields, you can put ../../methods-auto/record/record-calcfields-method statements in this trigger to have them calculated. While it is normally easier to use the ../../properties/devenv-calcfields-property to have it done automatically, there are situations where you have to use this trigger to perform the calculation explicitly. For example, if you apply FlowFilters based on the context of the report or the XMLport to the FlowFields inside this trigger, you need to recalculate the FlowFields after you have applied the FlowFilters.\nAnother example is when you need to retrieve information from a table that is external to the report or XMLport. This is the situation when the records of a data item contain fields that are foreign keys \\(that is, fields that are primary keys in other tables\\), and you want to extract further information from the related tables. For example, in a report, the records in a data item might contain a field with a Vendor code, while you want to print the full name and address of the vendor. You use this trigger to retrieve the information in order to print it in your report.\n## Related information\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>\n../page/devenv-onaftergetrecord-page-trigger\nOnAfterGetRecord (Request Page) Trigger<../requestpage/devenv-onaftergetrecord-requestpage-trigger>\nOnAfterGetRecord (Request Page Extension) Trigger<../requestpageextension/devenv-onaftergetrecord-requestpageextension-trigger>\nOnAfterGetRecord (Page Extension) Trigger<../pageextension/devenv-onaftergetrecord-pageextension-trigger>\nOnAfterGetRecord (Xml Port Table Element) Trigger<../xmlporttableelement/devenv-onaftergetrecord-xmlporttableelement-trigger>"}