Rules to better CRM for Developers

Since 1990, SSW has supported the developer community by publishing all our best practices and rules for everyone to see. ​

If you still need help, visit ​Microsoft Customer Relationship Management CRM | SSW Consulting Sydney, Brisbane & Melbourne​ and book in a consultant.​​

Hold on a second! How would you like to view this content?
Just the title! A brief blurb! Gimme everything!
  1. Do you know the best way to demo Microsoft CRM to clients?

    If in the office:

    • Option 1 is the Outlook Client - connect to the demo organization (you will need to deploy a demo org first).
    • Option 2 is the Web Browser - connect to the demo organization (you will need to deploy a demo org first).

    Note: If not in the office (say at a client site) with an Internet connection, only demo with a strong Internet connection. eg. at least 1MB on speedtest.net

    Away from the office options:

    • Option 3 is Offline Outlook Client (but you cannot demonstrate all of the functionality such as Administration Settings)
    • Option 4 CRM Online Trial – Sign up for a free 30 day trial, this can be used to demo to the client and then (optionally) the client can continue to access the trial to further evaluate CRM. (recommended, except signing up for the trial is a little bit of pain)

    If there is no Internet connection then work offline:

    • * Option 5 is a Virtual Machine Self hosted (Win 8 + Hyper-V being the latest stack) – with internal network connection shared up between host and guest. Host IE10 and Outlook 2013 on Win 8 offer best user/demo experience.

    You should be able to show:

    • Accounts (aka Companies)
    • Contacts
    • Sales (aka Leads and Invoicing and Quoting)
    • Marketing (aka Campaigns)
    • Service (aka Support)
    • Mail Merge
    Figure: Outlook​ with the CRM plugin
  2. Do you identify Development, Test and Production CRM 2016 Web Servers by colors?

    ​As per rule "Do you have separate development, testing and production environment?", it's better to use different background colors to identify Development, Test and Production servers.                                                                                                                                                                   

    crm staging.png    Figure: Staging uses blue background
    crm production.pngFigure: Production uses red background 

    The way to change the default background color is to edit the CRM css files. These changes aren't supported and may be overwritten when CRM Rollups are applied.

    CRM 2015 and CRM 2016

    Using theme feature to change the environment color.

    CRM2015Theme.JPG 

      
    ​  Figure: Changing CRM 2016 UI by using theme feature

    CRM 2013

    Edit: <CrmWebsiteRoot>\_controls\navbar\navbar.css

    .navigationControl
    {
    background-color: #006600;
    margin: 0;
    z-index: 999;
    float: left;
    width: 100%;
    position: relative;
    }

     Figure: Edit the background color to reflect the environment

     crm2013_greenbar.jpg

     Figure: CRM 2013 with a green navigation bar       

    CRM 2011

    Edit <CrmWebsiteRoot>\_static\css\1033\cui.css, locate and modify the section ms-cui-tabBody so that it reads:

    background-color : #ffffff;

    Change color to a suitable color for the environment:

    background-color : #bbffaa; 

     

    Figure: CRM Ribbon color green to signify production environment

    CRM 4

    Edit, <CrmWebsiteRoot>\_common\styles\global.css.aspx

             body.stage
                {
                    <% if (CrmStyles.IsRightToLeft) { %>
                        dir:rtl;
                    <%} %>
                    border-top:1px solid #6893cf;
                    /* background-color: #d6e8ff; */
                    background-color: #ffff00;
                    padding: 4px;
                    /* background-repeat: repeat-x;
                    background-image: url(/_imgs/app_back.gif);
                      */
                }
           
    Figure: In C:\Inetpub\wwwroot\_common\styles\global.css.aspx comment out and change the reference in yellow so the users know what server they are on
    Color of CRM Development Server
    Figure: Color of CRM Development Server - Red
    Color of CRM Test Server
    Figure: Color of CRM Test Server - Yellow
    Color of CRM Test Server
    Figure: Color of CRM Production Server - Default

     



  3. Do you know how to correctly use the terms Configuration, Customization and Extending in the CRM context?

    It is important to use consistent language when talking about changes made to a CRM environment. The terms configuration and customization are sometimes used interchangeably.  It is clearer to use the following to differentiate them: Configuration, Customization and Extending.

     

    Configuration applies to any changes made to existing options available within the default installation of CRM, examples might include changing the default currency from USD to AUD or the way emails are sent; using the Email Router instead of Outlook etc.
    Configuration applies to objects like: Business Units, Security Roles, Users, Teams, Field Security, Auditing, and Solutions

    Customization is anything that can be done within CRM without resorting to the SDK or external code. Adding new fields to an existing entity, creating new entities, option sets, reports etc.
    Customization would apply to: Fields, Entities, Relationships, Forms, Views, and Charts, Workflows, Imports etc.

    Extending is anything that involves writing custom code. This could be a plug-in (SDK) or JavaScript code (external code).

    See the TFS​ rule for correct definitions.

  4. Do you turn on 'Development Errors' and 'Platform Tracing'?

    ​​When exceptions occur in CRM they are trapped by the platform layer and a standard error message is displayed to the user. At SSW we similarly implement exception handling and use SSW Code Auditor to audit exception handling.

    By turning DevErrors on (mainly applicable to CRM 3 and 4) you will obtain the actual error. This is what that will be posted onto newsgroups. Microsoft Support should also ask you for this information, so you probably cannot do any meaningful troubleshooting until this has been activated. To switch DevErrors on, open the web.config and change DevErrors value ="On".

    DevErrors in web.config
    Figure: Turn on DevErrors within Web.Config file to get details of error

    In CRM2011 we accomplish the same thing by turning on tracing. For more information on tracing refer to MS KB907490.

    Now if all that info on the MS KS was too much, use the Diagnostics Tool for Microsoft Dynamics CRM 2011. It makes collecting trace information a snap.

    Figure: Diagnostics for CRM2011
    Figure: Diagnostics for CRM2011
  5. CRM2013/2015 - Do you use CRM Business Rules to automate forms?

    ​Prior to CRM 2013 if a CRM user wanted to:

    • Show an error message
    • Set a field value
    • Set business required
    • Set field visibility (show/hide fields)
    • Lock or unlock a field 

    They would normally need to get a CRM developer involved to write JavaScript code to automate these actions.

    Starting with CRM 2013 (and much improved in CRM 2015), users can now use Business Rules to automate these actions without getting a CRM developer involved.

    ​​Take the following Example:

    Figure: ‘Customer Type Other’ should be hidden and only displayed when Other is selected

    To make this work use the following Business Rules:

    Figure: Show the ‘Customer Type Other’ field when Customer Type equals Other

    The flip side of the expression also needs to be set where Customer Type doesn’t equal Other to hide the ‘Customer Type Other’ field (you could also optionally clear this field too)

    Figure​: Hide the ‘Customer Type Other’ field when Customer Type doesn’t equal Other

    Finally the last step is to Activate the Business Rules. To activate click the activate button on the top right of the tool bar.

    Now the form will look like this:

    Figure: Great. Now ‘Customer Type Other’ is hidden
    Figure: And on the other side ‘Customer Type Other’ is visible

    Note: CRM 2015 further improves on this by introducing the if… else… construct, so instead of creating two business rules (one for show and one for hide), this rule can be reduced to just one.

  6. CRM2013 - Do you use Real-Time Workflows instead of Javascript and/or Plugin Code?

    CRM Workflows have always been a great option to create, update and delete data when a certain action has occurred, eg: When a customer is created, create a task for sales to update contact information. This is an example of an asynchronous workflow ie: it occurs after the record is created at some time determined by CRM.

    CRM 2013 adds real-time (synchronous) workflows. These workflows run in sync with the record. An example of this might be a setting a Lead’s Estimated Value too high (say greater than $100,000), if a user enters a value greater than $100,000 the value isn’t going to be accepted.

    ​First Create the Workflow (don’t forget to uncheck the Run this workflow in the background):

    Figure: Create the Workflow

    Second, set the properties of the workflow:

    In this example it’s set to when ‘Est Value’ field changes
    If ‘Est Value’ is greater than $100,000 then stop and cancel

    Figure: Stop and cancel if ‘Est Value’ greater than $100,000

    ​Once the Real-Time workflow is Activated the ‘Est Value’ field will no longer accept values above $100,000. This is a simple example but in versions prior to CRM2013 this would have been implemented in Javascript or Plugin Code.

    Using the Real-Time Workflow saves a lot of time and effort.

    Figure: Lead cannot be saved if Est value is greater than $100,000
  7. Do you use Filtered Views or Fetch for CRM Custom Reports?

    The built-in CRM report wizard is great for users to quickly and easily create reports in CRM.

    Figure: The starting point

    But when the user wants to create a report that needs additional totals, different formatting, summaries in the header etc. A custom report is required.

    Do you use Filtered Views or Fetch?

    Filtered Views allows the report developer to query underlying SQL data directly. Filtered views are fully compliant with the Microsoft Dynamics CRM security model. When you run a report that obtains data from filtered views, the Microsoft Dynamics CRM security role determines what data you can view in the report.

    Figure: Filtered Views in the CRM SQL Database

    Fetch is a proprietary query language that is used in Microsoft Dynamics CRM. It is based on a schema that describes the capabilities of the language. The FetchXML language supports similar query capabilities as query expression. It is used primarily as a serialized form of query expression, used to save a query as a user owned saved view in the userquery entity or as an organization owned view in the savedquery entity.

    Now with that out of the way which one do I use?

    1. If you’re using CRM Online then you have no choice, you will use Fetch as CRM Online does not allow access to the underlying CRM SQL Database.
    2. If you are using On-Premise CRM and are *unlikely* to ever migrate to CRM Online then Filtered Views is the right choice.
    3. If you are using On-Premise CRM and there is *any* chance of moving the CRM Online then use Fetch (otherwise your custom reports will need to be re-written to use Fetch).

    Fetch Restrictions:

    • Fetch does not support RIGHT OUTER JOIN and FULL OUTER JOIN.
    • Fetch does not support EXISTS/IN condition with sub-query/expression.
    • An amount of 5000 returned records maximum.
    • No “UNION” selects.
    • You cannot specify group by / sum queries – You can only select the records in detail and then perform the aggregation in your report.
    • Number of entity join (link) limitations.
    • FetchXML reports cannot use non-CRM online data sources.
    • Learning curve – for report writers that are not familiar with FetchXML the syntax is quite different from SQL.

    What do you need get started writing Fetch based CRM Custom Reports?

    Get up and running quickly with Fetch:

    1. Create your report using the CRM Reporting Wizard
    2. Save the RDL file
    3. Import RDL file into Reporting Services Project
    4. Update and enhance report
    5. Upload back into CRM

    More advanced users will have a boilerplate(s) for the various CRM report styles they produce and just build on top of the template.

    Here’s an example of a before (CRM Wizard) and after (Visual Studio) for an Activity Report:

    Figure: Report created using CRM Wizard
    Figure: Report updated in Visual Studio

    Five enhancements that required a custom report:

    • Company logo top left
    • Total call minutes in header
    • Total call count and minutes totals for staff
    • Links to regarding account (in a grouping)
    • Colour coded series for charts that relate back to the report data headings

    More Information:

  8. Project Planning - Do you download a copy of the Microsoft CRM Implementation Guide?

    The Microsoft CRM Implementation Guide contains essential information on installation pre-requisites and planning, implementation tools and troubleshooting.

    Using the CHM (Compiled HTML Help) makes searching easier than using a word or pdf document.

    Implementation guide screenshot
    Figure: Searching the CHM version of the implementation guide is much nicer than the Word document
  9. Installation - Do you know that your organizational chart does not equal your CRM Business Units?

    Usually there is not much point creating an over-complicated organizational structure in MSCRM, a flatter organizational chart will achieve the same end result. Whilst the security model of Microsoft CRM is highly configurable, most organizations do no need to have excessive differentiation of data ownership and hence could cut down on unnecessary work. It is recommended to use the "out of the box" roles for almost all organizations less than 30 users.

    Microsoft CRM Default Security Roles are good enough to start with
    Figure: Microsoft CRM Default Security Roles are good enough to start with - this is not a thing to stuff with early on

    First thing first... never delete an Out of the Box (OOTB) role. Instead just disable... Period. The reason is it can cause system instability when the only solution can be to start from scratch with a New Organization.

    CRM Roles and Business Units (BUs) are related but quite separate in concept. When designing security roles, there are two schools of thought - job function oriented and functional task oriented. Hybrid model is commonly seen as well.

    BU's don't normally equate to an Organization Chart in real life, and more often than you might realize.

    Considerations when designing BU's:

    • Security
    • Data ownership
    • Operations and collaborations
    • Business functions
    • Geographical locations

    In CRM 2011, two new features help in simplifying security design:

    1. Multiple forms per entity can be assigned to different security roles
    2. Field level security to add to the next level of security granularity
  10. Customization - Do you check custom JavaScript with the CRM Custom Code Validation Tool?

    ​As of the December 2012 Service Update (online) and Rollup 12 (on-prem) CRM HTML Components (HTC) are disabled by default. This means any JavaScript that references the V4 API will fail. Using the CRM Custom Code Validation Tool will help you to track down this legacy code and update it. It is not recommend to re-enable the HTC controls as it will just create more problems down the track.

    To use the CRM 2011 Custom Code Validation Tool, download the zip file from Microsoft and install the solution into CRM2011. Once installed in CRM you will be able to run the validation tool over the custom JavaScript. Issues in red highlight deprecated functions and should be fixed immediately, issues in blue are uses of undocumented functions, while not as important they should also be checked.

    CRM-2011-Custom-Code-Validation-Tool.png 

    Figure: Using Custom Code Verification Tool

    Download the CRM 2011 Custom Code Validation Tool from: http://www.microsoft.com/en-us/download/details.aspx?id=30151

     

  11. Do you know the 6 ways to integrate your CRM 2011 data into SharePoint 2010?

    You have data in CRM 2011, so how do you see it in SharePoint? The data that is stored in CRM entities should be available in SharePoint so users can find and use the data in areas such as:

    - SharePoint search

    - SharePoint reporting (if you are using SQL Reporting Services in integrated mode)

    There are many ways to get to this data, let's go through them:

    OPTION 1: SharePoint BCS A​​dapter (provided by the CRM Team) RECOMMENDED

    This BCS Adapter for CRM 2011 is from the CRM team (It does all of the BCS work for you by interrogating the CRM metadata service).

    Summary: SharePoint BCS -> Pre-built Adapter (.NET Assembly) -> CRM web services - > CRM database

    Pros

    Cons

    clip_image002[8]Read/Write

    clip_image002[9]Minimal coding

    clip_image002[10]Easiest to implement

    clip_image002[11]The likely way forward (Best Practice as Microsoft)

    clip_image004[13]Needs to be deployed and published to the web server.

    clip_image004[14]Less performance than SQL filter views directly

    clip_image004[15]Only recently released.

    clip_image010 
    Figure: CRM data available in SharePoint

    More information:

    Download from Microsoft

    Read "Connecting to CRM Online 2011 with SharePoint 2010 Business Connectivity Services"

    Run tool to generate the XML mapping (.BDCM)

    This solution uses a BCS Connector – a .NET Assembly responsible for mapping external data into a form usable by SharePoint. This component is loaded and hosted within SharePoint 2010, and communicates with CRM via the CRM Proxy Service.


    Option 2: SQL Server Filtered Views

    CRM recommends that you *don't* read from the Tables, so they provide SQL Views for this purpose.

    Summary: SharePoint BCS -> CRM database

    Pros

    Cons

    clip_image002Easiest

    clip_image002[1]Best performance

    clip_image002[2]Codeless

    clip_image004Read-only

    clip_image004[1]Not available for hosted CRM

    clip_image004[2] Security issues as you are exposing the view.

    Filtered Views in Microsoft CRM provide access to the data available that supports providing picklist name and id values (lookup tables).

    More information:

    If you only want read-only for CRM on-premises data for SharePoint users, this solution is fine. You create the External Content Type directly against the Filtered Views in the CRM database. 

    http://msdn.microsoft.com/en-us/library/gg328467.aspx

    clip_image005 

    Figure: The result of “SELECT * FROM FilteredCtx_Project”. Use Office SharePoint Designer to hook this up.


    OPTION 3​: Web Services

    CRM provides web services.

    Summary: SharePoint BCS -> Code calling CRM web services - > CRM database​

    Pros

    Cons

    clip_image002[3]Read/Write

    clip_image004[3]Needs lots of code and test work.

    clip_image004[4]Needs to be deployed and published to the web server.

    clip_image004[5]Less performance than SQL filter views directly #1

    #1 Note: Performance could be improved by making the reads from the views and the writes through the web service

    More information: 

    1. Use BCS in VS 2010

    2. Write code that calls the CRM web services (that access the CRM data)

    3. Test

    4. Deploy


    OPTION 4​​: Expose OData from CRM as RSS

    The CRM 2011 OData Query Designer can be used to build queries to expose the data from CRM as RSS

    Pros

    Cons

    clip_image002[4]Easy configuration

    clip_image004[6]50 records limit. Need to page through the results.

    clip_image004[7]Possible issues with firewalls and proxies because it uses Integrated Security for authentication.

    clip_image004[8]Read-Only

    clip_image004[9]No easy way to consume


    Note: You can really only call the OData endpoint from an application that already has an authentication cookie with the CRM server.
    i.e. you can't impersonate and call it like you can the standard WCF endpoints
    So it is really only suited to calling from Silverlight and JavaScript web resources that are delivered inside CRM (because they have the cookie)

    More information:

    The first step is to expose the data:

    1. Install http://crm2011odatatool.codeplex.com

    2. Make a query

    clip_image006 

    Figure: Designing a query

    3. See the data

    /SoftwareDevelopment/rulestobettercrm/PublishingImages/figure3.jpg 

                    Figure: See the data - RSS source for xtc_countrySet

    The second step (and the problem) is consuming the data

    clip_image009 

    Figure: BCS has no option to consume RSS data. Please Microsoft SharePoint Team, we need a new 'Data Source Type' = OData

    In summary, CRM 2011 can exposes OData, but SharePoint 2010 BCS doesn't consume OData.

    The 3 options to consume the OData/RSS data:

    · Consume the OData by SQL Server, via TSQL ???    Then use BCS to call SQL Server.
    Summary: SharePoint BCS -> DataSourceType: SQL Server -> OData- > CRM database

    You would need to be crazy to go down this route http://www.vishalseth.com/post/2009/12/22/Call-a-webservice-from-TSQL-(Stored-Procedure)-using-MSXML.aspx

    · Consume the OData by a BCS adapter + code calling web services (same story as above).
    Summary: SharePoint BCS -> code calling OData- > CRM database

    · Consume the RSS by "SharePoint RSS view web part" directly.
    Summary: SharePoint RSS view web part -> OData- > CRM database
    (not recommended as it could not be used in "SharePoint Search")

    So OData is all things horrible because it is hard to eat :-(


    OPTION 5: BizTalk​

    Biztalk is built for mapping systems together, unfortunately this solution is only considered for large enterprises.

    Summary: SharePoint BCS -> BizTalk Database - > CRM database

    Pros

    Cons

    clip_image002[5]Read/Write

    clip_image002[6]The BizTalk data centre can also provide data for any system.

    clip_image002[7]Requires little code if users already have BizTalk

    clip_image004[10]BizTalk :-)

    clip_image004[11]Deployment - Needs external work to deploy BizTalk server.

    clip_image004[12]Licence Cost



    Option 6: OData 3rd Party solutions (doesn't exist)

    Today SharePoint 2010 exposes lists and document libraries as OData, but does not natively consume OData.

    What does this mean?

    - CRM 2011 exposes it data as OData, but cannot consume OData

    - SharePoint 2010 exposes it data as OData, but cannot consume OData

    ....and there are no 3rd party solutions to solve this...

  12. Customization - Do you have only one person making changes to your CRM customization?

    With CRM4, customizations cannot be undone and are cumulative, e.g.​ if you add an attribute on a form and deploy, there is no easy way to remove the attribute from the entity. We have a suggestion to CRM on this issue.

    In order to remove the attribute, what you have to do:

    1. If attribute is not a required field then go to step 3.
    2. Set attribute to be not required field
    3. Save and publish the changes
    4. Remove attribute from the form
    5. Save and publish the changes
    6. Remove attribute from the entity
    7. Save and publish the changes

    Because of this reason, we have to take extra care in tracking and maintaining the CRM customization changes. So the solution:

    1. Make someone (that person is called CRM Champion) in charge of schema changes
    2. Define security roles so that only this person can make customization changes
    3. Everyone else has to send customization changes to the CRM Champion in development team
    On larger scale projects, functional design documentation governs the customization and on multiple member project teams, it’s normally the BA(s), who are in charge of designing and configuring CRM. Developers rarely configure the system unless acting in a BA capacity.
  13. Customization - Do you know which version of SQL Reporting Services and Visual Studio you are using?

    CRM 2011 is designed to work with:

    • SQL Server 2012 (CRM Update Rollup 6 or greater required), SQL Server 2008 (or 2008 R2)
    • SQL Reporting Services 2012, SQL Reporting Services 2008 (or 2008 R2)
    • .NET Framework 4.0 for Plugins, .NET Framework 4.0 or 3.5 for Visualizations (Charts)

    Make sure you are using the correct version of Visual Studio to edit reports, either Visual Studio 2008 or Visual Studio 2010 or even better use Visual Studio 2012 and SSDT-BI to edit Report files.

    The benefit of using SSDT-BI is you will be able to target SQL Reporting Services 2008-2012 without having different versions of Visual Studio installed.

    SSDT-BI can be downloaded from: http://www.microsoft.com/en-au/download/details.aspx?id=36843

    History

    CRM 3.0 is in .NET 1.1 so it was designed to work with:

    • SQL Server 2000 (even better to use 2005)
    • Reporting Services 2000 (design reports in VS.NET 2003)
    • Callouts in VS.NET 2003

    Tip #1: Do try to use SQL 2005 if available - it is marginally faster.

    Tip #2: Don't try working in VS.NET 2005 - there are workarounds but they become very, very painful.

    Tip #3: SQL Reporting Services and the .rdl files are not backward compatible - there is no hope of doing them in 2005 and back porting the RDL.​​

  14. Customization - Do you set the schema-name prefix?

    Note when you do a customization it gives it a prefix with the schema name - in our case SSW. With this prefix you can easily distinguish customized attributes from default attributes.

    Set your schema-name prefix to use for custom entities and attributes
    Figure: Set your schema-name prefix to use for custom entities and attributes
    customized attributes with the prefix
    Figure: customized attributes with the prefix
  15. Customization - Do you have your customizations documented?

    You will want to have a list of all customizations - from Custom Entities to Callouts. You can export the customizations to an XML file - but that is not fun to read. There is no tool to document or any visual tool to look at - so the best thing is screen captures with circles highlighting the customized areas.

    ​The following tools can also help you to export this data:

    Metablast by Somona Partners http://blog.sonomapartners.com/2011/05/metablast-get-your-microsoft-crm-entity-schema-data-now.html

    Metadata Browser by Rhett Clinton http://crm2011metabrowser.codeplex.com/

    CRM Document Generator by Tanguy http://metadatadocgenerator.codeplex.com/

     

  16. Customization - Do you enable your contacts to have more than the default 3 email addresses and phone numbers?

    Out of the box CRM4 only enables a contact to have 3 phone numbers (home, business and mobile) + 3 email addresses (but only one visible). A customization that almost everyone needs is to remove this limitation (to allow contacts to have an unlimited amount of phone numbers and email addresses).
    Figure: Bad example - Out of the box a contact can only have 3 phone numbers and 1 email address

    There are a few customizations needed to get the SSW Contact Makeover:

    • Show some hidden fields
    • Make some form changes to move to a new tab
    • Make a CRM frame (to add in a subform)
    • Add some entities
    • Add some form java script to hide the core Contact Details? tab when a user is entering a new contact
    Figure: Good example - Enable the hidden fields and move it to a new tab. And now a Contact has 3 email addresses and phone numbers
    Figure: Good example - After adding an entity, you add a frame show the unlimited contact details (phone, fax, email etc)

    Q: So what is the end result?
    A: The end user experience to add a phone number is ..

    Figure:  Step 1: Double-click the contact (or right-click the contact and select Open) Open
    Figure:  Step 2: Select the tab 'More Contact Details'

    Figure:  Step 3: Click the button 'New Contact Detail'
    Figure:  Step 4: Enter the details and click button 'Save and Close' (top left)
  17. Do you avoid doing small bug fixes on your test-server?

    Don't make any changes to the test server, it can break your deployment process of your plug-in.

    Develop only on your development server.

  18. Do you put your exported customizations and your plug-in customization under source-control during deployment?

    If you export your customizations from your CRM Development server, put them under TFS source-control, so that TFS is your central repository for everything, and you have all the advantages of a source control system.

  19. Do you export your configuration on deployment using the CRM Plug-in Registration Tool?

    Instead of configuring your plug-in manually in the registration tool, export all settings and import them on the other server.

  20. Customization - Do you use a supported method of customization?

    The Microsoft CRM customization tools make it no longer necessary for you to hack ie. write triggers, stored procedures and .aspx pages. In fact if you were to do any of these your CRM is unsupported. Changes will not be preserved in any upgrades or fixes and Microsoft will not attend to any of your support calls until you revert your CRM back to a supported state.

    The common ways to customize are:

    1. Use the designer to add Entities and Forms (aka Tables and Forms)
    2. Write SQL Reporting Services Reports
    3. Write workflows with the CRM designer
    4. Write workflows with VS.NET and .NET 3.0 WF (new since CRM 4.0)
    5. Write callouts with VS.NET (the extension points made available)

    The diagram below briefly outlines what are possible supported methods of customization.

     Microsoft CRM Customization Architecture
    Figure: Microsoft CRM Customization Architecture

    Refer to P19 of the CRM Customization Manual Course 8525A for a more in depth discussion.

    PS: For CRM 3.0 you can't find everything on the web - you will need the CRM Customization Manual Course 8525A - you have to buy it from Microsoft :-(

  21. Customization - Do you know how to change default CRM logo?

    The name of default crm logo is 'masthead.jpg' which is located under directory '_imgs' of the crm web folder. Rename this file to, say, masthead_backup.jpg and put your company logo and name it as ''masthead.jpg'. Done!

    Change CRM company Logo
    Figure: Change CRM company logo
  22. Customization - Do you export only the customizations of entities that you did customize?

    Export each single entity customization and keep each entity customization in a separate file, like:

    • Account_11022009.xml
    • Contact_11022009.xml

    This way, if an entity is changed or broken on the Live environment, you can re-import the customization for this entity again, without breaking other entities on live environment.

    Instead of exporting each single entity, you can also export only your customized entities in 1 step, and afterwards select what entities to import

    Import single customization
    Figure: You can select the single customization to import
  23. Customization - Do you have a naming convention for your customization back up? (CRM 4 only)

    Keeping track of CRM customization changes is just as difficult as back-end database changes. We have a rule Is a Back-end structural change going to be a hassle? which provide you an example how you should keep track of back-end changes. You can apply this rule to CRM changes and use a naming convention on each customization backup file to identify and keep track of your changes. 

    Your customization file name should be: 

    [IncrementalNumber]_[Entity]_[Date].zip, for example: 001_account_29042009.zip 

    The file's name can tell you which entity you made changes and which date the changes were made. The incremental number will provides us step by step instruction on how to produce the current CRM system from a vanilla Microsoft Dynamics CRM.

    CRM2011 has significant improvements in this area with Solutions. In CRM 2011 we use versioned solutions along with source control.


  24. Customization - Do you have email address in the Associated Contact View?

    In default view for Associated Contact you cannot see the email address, it would be better to customize it as an extra column.

    Associated Contact View without the email address
    Figure: Associated Contact View without the email address
    Associated Contact View with the email address
    Figure: Associated Contact View with the email address

    It is easy to do this by import the customisations xml files.

  25. Customization - Do you only export the customizations and related ones that you have made?

    Sometimes less is better, CRM customizations are cumulative, this means that a customization that you import will override your existing schema. So if you're only working on for example Account entity, you should only export the Account entity's customization and any related entities in any new relationship that you have added to the schema. This avoids unexpected overriding existing entity's customization that potentially can break your CRM system.

    Account entity has relationships with pretty much every other entity in CRM.

    You could also export all the customizations and then just import the customization and the related ones that you have made changes. However, this requires you taking an extra effort to take note of which customizations that you have made changes.

    In CRM2011, there is  dependencies as solution items. It depends on the circumstances whether to make it a managed or unmanaged solution. E.g. ISV v.s. one man shop.

    If you are an ISV and shipping solutions to the marketplace, you have no choice but to use managed solutions. If you are a CRM consultant and building a repeatable industry solution that you want to service many customers with, use managed solutions. If you are an enterprise development shop and building a departmental xRM application that is going to have multiple installations in different orgs, use managed solutions. If you are building integration components for back-office systems, use managed solutions for those. 

    *In all other cases, use unmanaged solutions*.

  26. Customization - Do you use the built-in test form events before you publish JavaScript changes?

    Generally you will add Javascript to the form to give client side validation.

    Given JavaScript is difficult to debug and doesn't get precompiled this can save a lot of time rather than re-publishing all the form changes and having to reload and refresh the forms manually.
    These events can be trigged using the Preview menu from the form customization environment.

    Test your Javascript via the Preview menu in the Custom Forms Designer
    Figure: Test your Javascript via the Preview menu in the Custom Forms Designer
  27. Customization - Do you always make backup versions of the XML schema? (CRM 4 only)

    When the XML schema is published it re-generates the underlying SQL and .aspx code. If trouble hits, a "refresh" or "rollback" to an uncorrupted schema is always a backup plan. A versioning scheme is also required to keep track of different versions of the XML schema at different points in time. To make a backup of the schema from within Microsoft CRM navigate to Settings -> Customization -> Export Customizations. Browse to the location on your personal hard drive where the .XML file is to be stored.

    Microsoft CRM Customization Pane
    Figure: Export customizations as backup

    Tip #1: Export only the customizations of entities that you customize and keep each entity customizations in a separate file, see the rule:Customization - Do you export only the customizations of entities that you did customize?

    Tip #2: Put the date on the file names and while you are working you will be doing this multiple times a day.

    Tip #3: don't save this on the Dev Virtual Machine.

    In CRM 2011 we use Solutions and TFS Source Control.

  28. Data Migration - Do you prioritize the data that is to be imported?

    Step 1 - What data?

    1. Don't take all the data for the first release - Usually there are huge amounts of data in legacy systems - take only the most important firstly.
    2. Using the planning spreadsheets included with the Microsoft CRM Data Migration Pack - they are excellent for specifying data migration field mappings.

    Step 2 - Sync or import?

    1. Syncing and keeping the old system live is the preferred option
    2. Consider writing .NET callouts - or consider Scribe Insight
  29. Do you make batch files for deployment to Test and Production servers?

    The goal is that I don't want CRM developers to move from Dev to Test and to Production manually. Basically I don't want a developer to touch Test or Production servers. The testers can run the .bat file. See SSW rules to setup packages.

    How developers should work?

    Create a Deployment.bat like this

             
                REM (deploy the callouts - Part 1)
    
                REM (restart IIS of CRM TEST Server - BASILISK)
                iisreset BASILISK
    
                REM (copy callouts dlls onto CRM TEST Server - BASILISK)
                copy Microsoft.Crm.Platform.Callout.Base.dll "\\BASILISK\C$\Program Files\Microsoft CRM\Server\bin\assembly"            
                copy SSW.TimeProIntegrationCallouts.dll "\\BASILISK\C$\Program Files\Microsoft CRM\Server\bin\assembly"            
                copy callout.config.xml "\\BASILISK\C$\Program Files\Microsoft CRM\Server\bin\assembly" 
                
                REM (deploy the callouts - part 2)
                REM Stop the WorkFlow Service (as we need to remove the lock on the .dlls)
                REM Start it 
                REM (avoid workflow in v3 - see comment above C but if you do you need to)
                REM Manual - use Import wizard
                REM (avoid server side validation logic in v3)
                REM  Deploy a 1.1 web service
             

    Deploy to Test Server

    • Import the customizations.xml
    • Run .bat file

     

    Deploy to Production Server

    • Import the customizations.xml
    • Run .bat file
  30. Form Design - Do you change contact method options from default option group to checkboxes?

    CRM contact methods
    Figure: Bad Example - By default CRM uses option group for contact's and account's contact methods.

    As per our rule Do you know when to use CheckBox?. Checkboxes should be used instead of the option group since the answer is a boolean type. You can change the option group to checkboxes by:

    1. From CRM, go to Settings | Customizations | Customize Entities
    2. Double-Click "Contact" entity
    3. Click "Form and Views"
    4. Double-Click "Form" to edit contact form
    5. Click "Administration" tab
    6. Select a contact method field, i.e. Email
    7. Click "Change Properties"
      CRM contact methods form design
      Figure: Select and change the email field's properties.
    8. Click "Formatting" tab
    9. Change layout from "Two Columns" to "One Column" and select "Check box" as control formatting
    10. CRM email field properties
      Figure: Change layout and control formatting of email field to one column type and check box.
    11. Repeat steps 6-9 for other contact method
    12. Repeat steps 3-9 for account entity
    CRM contact methods with checkboxes
    Figure: Good example - Checkboxes are used for contact methods because they're clear and simple.
  31. Do you have proper tools in your tool belt?

    There are a few tools you can use to easy your CRM development:​
  32. Do you know how to configure email sending

    ​When configuring your email settings for Dynamics CRM, make sure you configure Serverside Sync.

    As per CRM Tip of the Day https://crmtipoftheday.com/979/start-planning-farewell-party-for-email-router/ the CRM Email router is to be deprecated. You should use the Serverside Sync now instead

    ​​​​Figure: Bad Example - Deprecated Mail routed Enabled

    Figure: ​​Good Example - Serverside Sync configured as per https://technet.microsoft.com/en-us/library/mt622063.aspx​

  33. Do you turn off auto update on your servers?

    It is not a good idea to have Windows Update automatically updating your servers.  There are a few reasons.

    1. The hotfix could bring down a production environment. (This issue previously happened)
    2. In fact, even in a development environment this could be hours of lost work as the development team struggles to understand why only some of the developers' servers magically and mysteriously broke overnight.
    3. Windows Update could restart your server, or put your server in a state where it requires restarting - preventing any urgent MSI installs without bringing down the server.

    Windows Update remains the best thing for end-users to protect their systems.  But in a server, especially a production server environment - Windows Update patches are just like any new versions of the software that's built internally.  It should be tested and then deployed in a controlled manner.

    So recommendations:

    1. Windows Updates may be critical and should be kept relatively up to date.
    2. Have a plan where your awesome Network Admins schedule time to keep the servers up to date - including testing that the servers still perform its functions.
    3. Turn off Automatic Windows Update on Windows Servers