Skip to main content

Development Standards for Dynamics CRM

In xRM development, nearly every solution requires some custom development in order to extend Dynamics CRM for business scenarios outside CRM functions such as sales force automation and customer service.  As with any software development, strong naming standards will help your developers and testers save time and produce a better solution.

Here are some modest suggestions:
  • Be generous in comments inside your code.  The next developer who takes over will thank you.
  • Provide unified coding standards on the JavaScript libraries.
  • Use consistent file naming conventions.
  • Use only one .JS file per form for the form-specific logic.
  • Don't write JavaScript event handlers from the control property window rather than as part of the JavaScript file associated with the form.
  • Create standard common function libraries, to address common functionality across forms. 
  • Use JavaScript or business rules (in Dynamics CRM 2013) to show/hide/enable/disable controls rather than creating multiple similar forms.
  • Be consistent in designing the user interface, using the same control types with an eye toward the user experience.


Joe Newstrom said…
Hi Jim,

When you say use one .js file per form, but use multiple common libraries... are you saying that, in your opinion best practice would be to duplicate blocks of code in each .js file?

I can see this becoming a maintenance nightmare, and given that client side caching is the norm, am curious why a single .js file per form is your recommendation.

Thank you in advance,

Jim Townsend said…
Thank you for reading the post and for your helpful comment. I should have said one file per form for the form-specific logic as opposed to a shared library. I will update to reflect this.
Dmitri Riz said…
The best practice, for complex projects, is to use a customized solution build process.
All CRM artefacts should be contained within a CRM Packaging project (that gets added as part of CRM Dev Toolkit part of SDK).

Contents of packaging project get published during one of build steps.

Each form should load just one js web resource for performance and reliability.

If form needs multiple libraries to run (e.g. jquery, angular, … your custom js code), than resulting single form-level js web resource should be created during a special pre-build step from its constituting parts.
In the example above, you will have, in your VS solution, a folder or folders with individual JS files – 3 files in this case.

Pre-build step will (optionally) minify resources and append them together in an appropriate order in the single file (contained and managed by the Packaging project).

Also, during this prebuild step, you can validate resulting js using something like jslint, and terminate build if error count exceeds max.

When single form-level files are created, build process continues as usual – building other .NET assemblies, publishing CRM stuff etc.
Richard Foster said…
This comment has been removed by a blog administrator.

I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.

sofianan said…
nice post.I am impressed by the quality of information on this website.Thanks for sharing this post
erp software companies in chennai

Popular posts from this blog

The DATA Act Driving Grant Management Automation

The Digital Accountability and Transparency Act enacted in May 2014 calls for making spending data available in open, standardized formats to be published online.  It is a continuation of transparency initiatives and lessons learned with experiences such as, the 2009 economic stimulus under the Recovery Act and the spending site

Government grantees will have significant new administrative responsibilities.  Many organizations that were tracking grants in spreadsheets or documents will have to adopt more sophisticated automated grant management systems such as Microsoft Grants Manager to keep up with reporting rules.

For profit companies will lose some privacy as a result of this law.  Grant recipients will be required to disclose information including officer salaries.

Continued improvements to publishing grant opportunities such as may make it easier to find grants. These reforms together are designed to improve the effectiveness of grant prog…

Dynamics 365 for Government Contractors (GovCon) Frequently Asked Questions (FAQ)

One of InfoStrat's most popular solutions is Dynamics 365 for Government Contractors (GovCon).

Here are some answers to frequently asked question on this solution:
Can I add new fields to the solution?  -- Yes, the solution is fully customizable and you can add your own new fields to any form, view or report.Does Dynamics 365 for GovCon work on mobile devices?  -- Yes, Microsoft offers mobile apps for all the most popular platforms including iPhone, iPad, and Android phone and tablets.Does Dynamics 365 connect with bid data systems such as Deltek and Onvia?  -- Some information services, such as Onvia, offer integration with Dynamics 365.  Others require third party solutions such as the InfoStrat integration with Deltek GovWin IQ.What do customers typically customize for their unique requirements? -- Not all contractors follow the same steps in the capture process.  Most clients will tailor the business process to add or remove steps in order to match their sales methodology.  Of…

InfoStrat Joins Microsoft CityNext

This month my company InfoStrat announced its participation in Microsoft CityNext, a global initiative empowering cities, businesses and citizens to re-imagine their futures and cultivate vibrant communities. Through the Microsoft CityNext initiative, Microsoft and InfoStrat will help leaders to do “new with less,” by combining the power of technology with innovative ideas to connect  governments, businesses and citizens with city services that increase efficiencies, reduce costs, foster a more sustainable environment and cultivate communities where people thrive.
In a recent study, IDC named Microsoft the most trusted smart-city vendor. "Whether it's traffic congestion, citizen services, energy efficiency or operating costs, our Microsoft CityNext partners are equipped to tackle whatever problem or priority local governments want to address. Microsoft’s IDC smart-city scores are really a credit to our partners, which leverage our trusted cloud platform, powerful data analytic…