Is there any way I can find labels which are not used in D365 FO (labels which dont have references)?
Asked
Active
Viewed 229 times
1 Answers
3
The cross references are stored in database DYNAMICSXREFDB
. You can use a sql query to generate a list of labels that have no references.
This query uses two tables in the database:
Names
holds an entry for each object in the application that can be referenced.- The
Path
field of the table holds the name of the object (e.g./Labels/@FormRunConfiguration:ViewDefaultLabel
is the path of theViewDefaultLabel
in theFormRunConfiguration
label file. - Field
Id
is used to reference a record in this table in other tables.
- The
References
holds the actual references that connect the objects.- Field
SourceId
contains theId
of theNames
record of the object that references another object identified by fieldTargetId
.
- Field
The actual query could look like this:
SELECT LabelObjects.Path AS UnusedLabel
FROM [dbo].[Names] AS LabelObjects
WHERE LabelObjects.Path LIKE '/Labels/%'
AND NOT EXISTS
(SELECT *
FROM [dbo].[References] AS LabelReferences
WHERE LabelReferences.TargetId = LabelObjects.Id)
Make sure to compile the application to update the cross reference data. Otherwise the query might give you wrong results. When I run this query on a version 10.0.3 PU27 environment, it returns one standard label as a result.

FH-Inway
- 4,432
- 1
- 20
- 37