In CRM, the custom tables store metadata for any new fields, screens, lists or entities that are created.
Sometimes when I'm working on the front end that has been heavily customised, I may need to find where a custom field is referenced in the application. For example a custom field that was added to the company entity could be used in screens, lists or even reports; but which ones? How would I find out?
By running a SQL script in SQL Server I can find out where in the application that the field is referenced. This script is attached to this blog article.
For our example here, let's create a custom text field, 'comp_ExportTurnover' on the Company entity. Add this field to the Company Grid list and to the Company Entry Screen. Add a few test companies or update a few existing ones and include a turnover for the company. Run the attached script in the SQL Server Database Management Studio to find out which tables the new custom field is added. The results come back something similar to this.
I can see that my custom field is referenced in Lists and Screens, but which ones? I can write a select statement in SQL Server something like this
select * from dbo.Custom_Lists where GriP_ColName like '%comp_ExportTurnover%'
I get back the following result:
I can see from my result set that the comp_ExportTurnover is located in the Company Grid.
How about the screens?
select * from dbo.Custom_screens where Seap_ColName like '%comp_ExportTurnover%'
I can see from my result set that the comp_ExportTurnover is located in the Company Box Long screen.
Nice and easy.