CRM 2015 – Why filtered views are useful
If you have been a CRM developer for a length of time then you will certainly come across filtered views and they are useful and definitely something you should learn more about, particularly if you are going to be writing reports or accessing the CRM database directly.
The CRM database can be viewed and the data used but never changed directly – Hosk
- Direct changes to the SQL table are unsupported, this will result in Microsoft offering no or limited support if your CRM installation goes wrong. You can read more about why you should not create unsupported changes here
- When you use the CRM SDK to change a value it could update other fields and values, direct changes to the SQL will not
- There is no validation on the SQL tables, you could easily put in an incorrect value
- If you write SQL stored procedure directly against the CRM database tables this could stop working when a rollup or service patch is applied to your CRM organisation
You should be of the opinion directly changing values on the Microsoft CRM database is a big no no
Best practice is to avoid accessing fields directly from CRM tables, the database structure, tables and fields could all change in future releases, rollups and service packs.
So what is the alternative to accessing CRM data using SQL if you shouldn’t access the data directly?
Microsoft have created a filtered view for each database table and Microsoft will make sure these work even after future releases, rollups and services packs.
Start with the CRM database
- Data Access Platform
- Filtered SQL Views
What are filtered views?
Entity schema name | Entity type code | Report view name | Description |
---|---|---|---|
Account | 1 | FilteredAccount | Business that represents a customer or potential customer. The company that is billed in business transactions. |
AccountLeads | 16 | FilteredAccountLeads | Represents the intersect table for the accountleads_associationrelationship. |
- Filtered views have the same name as the CRM table but with the word Filtered prefixing it. Not all Entities have filtered views because some entities are system entities
- Filtered views will be automatically created for any custom entities you create.
- In CRM 2011 the filtered view contained all the fields in the base and the extended table.
- CRM filtered views exist for individual activity types e.g. (email, task, letter, etc)
Why are Filtered views cool
The benefits of Filtered views are
- Filtered views won’t break after patches, services releases and maybe upgrades
- Security is embedded in the view
- All the column names are in lower case
- Filtered views are automatically created and updated for custom entities
- Datetime fields are held in datetime and UTC
- Drop down values are held in filtered views
Filtered views won’t break after patches, services releases and maybe upgrades
Security is embedded in the view
Filtered views are created for CRM developers to use in reports. Filtered views use the Microsoft Dynamics CRM security model, so data shown in a report using a filtered view would only contain the data the users can view in CRM.
Filtered views take uses security levels e.g. organisation, business unit, owner and field level and these only show the levels each individual user can see.
If you created a view created directly on the Microsoft Dynamics CRM tables then it would show all the data to all users.
Adam summarises this excellently in his comment
Filtered views enforce security
All the column names are in lower case
All the column names in a filtered view are in lower case, so you do not have any problems with case sensitivity
Filtered views are automatically created and updated for custom entities
Microsoft is busy in the background and when you create a new entity or add fields to a custom entity or System entity, Microsoft automatically creates a new filtered view for custom entities and adds the new fields to existing filtered views.
Datetime fields are held in datetime and UTC
Filtered views have two datetime fields for every date time field you add. One DateTime field and one UTC DateTime field.
The DateTime field holds the date time for the users time zone
DateTime UTC holds the time in UTC
Drop down values are held in filtered views
Option sets have two fields in a filtered view, one holds the value the other holds the string representation
One field holds the string value of the option set
Another value holds the number
If you had an option set field accountrating with an option set value set of Gold – 1.
accountrating = 1
accountratingname = “Gold”
Primary Key Field
Denormalisation
In computing, denormalization is the process of attempting to optimize the read performance of a database by adding redundant data or by grouping data.[1][2] In some cases, denormalization is a means of addressing performance or scalability in relational database software.
- Guid
- Name
Problems with Filtered Views
- Lots of Teams in different BU’s
- Lots of sharing
Awesome stuff.
ReplyDeletecrm solutions company in hyderabad
crm based companies
crm for manufacturing companies
crm for construction companies
crm software companies
indian crm companies
top crm companies in india
top crm companies
crm companies in india
crm solutions company
crm companies in hyderabad
crm software in hyderabad
crm software providers in madhapur hyderabad
crm consulting companies