{"title":"DataItemLink property on query data items","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/properties/devenv-dataitemlink-query-property/","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/properties/devenv-dataitemlink-query-property, 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/properties/devenv-dataitemlink-query-property","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":"Learn how the DataItemLink property joins query data items by matching fields in their source tables in Dynamics 365 Business Central.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"DataItemLink property on query data items","slug":"dataitemlink-property-on-query-data-items","at":0,"chars":1534},{"level":2,"title":"Applies to","slug":"applies-to","at":192,"chars":32},{"level":2,"title":"Property value","slug":"property-value","at":224,"chars":354},{"level":2,"title":"Remarks","slug":"remarks","at":578,"chars":567},{"level":2,"title":"Example","slug":"example","at":1145,"chars":279},{"level":2,"title":"Related information","slug":"related-information","at":1424,"chars":110}],"text":"# DataItemLink property on query data items\n> Version: _Available from runtime version 1.0._\nSpecifies links between fields in a query data item and fields in one or more data items above it.\n## Applies to\n Query data items\n## Property value\n`Field=AncestorDataItem.ReferenceField`\n Field is the name of the field in the table of the lower data item.\n AncestorDataItem is the name of an ancestor data item.\n ReferenceField is the name of a field in the table of the ancestor data item.\n> NOTE\n> You can link to more than one column. Separate multiple column links with a comma.\n## Remarks\nThe DataItemLink property works with the devenv-sqljointype-property to combine records from tables into a dataset. It defines an equal-to (`=`) comparison between fields in the data item tables. The query combines records that have matching field values. Set DataItemLink on the lower data item in the query object.\n> NOTE\n> You can't set DataItemLink when SqlJoinType is set to CrossJoin. See Linking and joining data items to define the query dataset<../devenv-query-links-joins>.\n> You can't use FlowField or FlowFilter fields in a query DataItemLink.\n## Example\nA Salesperson data item and a `Sales Header` data item contain the Code and `Salesperson Code` fields, respectively. To link the data items, set the DataItemLink property on the `Sales Header` data item.\n```al\nDataItemLink = \"Salesperson Code\" = Salesperson.Code;\n```\n## Related information\n../devenv-query-object\ndevenv-sqljointype-property\ndevenv-dataitemlink-reports-property"}