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:
Namesholds an entry for each object in the application that can be referenced.- The
Pathfield of the table holds the name of the object (e.g./Labels/@FormRunConfiguration:ViewDefaultLabelis the path of theViewDefaultLabelin theFormRunConfigurationlabel file. - Field
Idis used to reference a record in this table in other tables.
- The
Referencesholds the actual references that connect the objects.- Field
SourceIdcontains theIdof theNamesrecord 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
