The CRM database is structured with views that prevent the need to query the tables directly. Each entity in CRM consists of two tables in the database. For example, the account entity consists of the AccountBase and AccountExtensionBase tables. The AccountBase table contains the out of the box attributes and any custom attributes are in the AccountExtensionBase table. The database has a view named Account that automatically joins those two tables so when querying for data you would query the view and use a query such as ‘select * from account’. This view also has joins to related tables based on foreign key ids to retrieve the name text value of the related entity. For instance, it contains the ownerid but also contains the owneridname which returns the name of the owner. This can prove handy when creating reports.
Another view also exists named Filtered
Most tables and views in CRM bear the same name as it is labeled in CRM yet a system customizer can rename an entity. Case is one object out of the box that has underlying tables with a different name. The Incident tables and views represent the Case entity in CRM. Any custom entites you create contain the customization prefix in the table and view name as defined in the CRM System Settings. Once the new entity is created, the supporting tables and views as I defined above are automatically created for you and no additional work is needed on the database end.
If ever you are unable to locate the tables and views that support an entity, you can locate that in the Microsoft Dynamics CRM interface. In CRM, click “Settings” in the Wunderbar, click “Customization” in the navigation links on the top left of the screen, and then select “Customize Entities”. Find the entity you are interested in by viewing the “Display Name” column as that represents the name used in the user interface. The “Name” column will show you what the underlying table/view name is in the database.
When you open an entity in the CRM customization area, you can locate the 1:N, N:1, and N:N relationships for that entity in the left navigation area. It will display the name of the foreign key id field in the related entity if you are viewing a 1:N relationship for instance.
This post should give you an idea of the database structure in Microsoft Dynamics CRM and the value it provides for reporting or other purposes.
Thank you for sharing this
ReplyDeleteChloros technologies