Quantcast
Channel: Hosk's Dynamic CRM Blog : crm 2011
Viewing all 469 articles
Browse latest View live

Testing CRM rollups and .NET versions

$
0
0

In this article I will talk about testing patches and how .NET versions can cause odd errors.

Rollups and CRM Version

I had a customer who was using CRM 2013 Service patch 1 and wanted to test their customizations still worked when CRM 2013 SP1 rollup 3 was applied.

Testing a new CRM service pack or rollup involves using a new server and CRM instance.

You can have many CRM organisations deployed on one CRM server but if you upgrade the CRM server it will effect all the CRM organisations and I don’t know any method to roll back rollups.

Why can’t you rollback CRM versions

To understand the question you need to think what happens (could happen) when you apply a rollup

  • Possible changes to the database tables
  • Update to CRM SDK
  • Depreciating certain functional in CRM SDK

Database changes

Microsoft might change the whole structure of the CRM database between service patches and rollups, which is one of the reasons Microsoft recommends you do not write any code/customizations/reports which run directly against the CRM database.  Microsoft provide filtered views and the CRM SDK for you to integrate the CRM database.

I think during the CRM 2013 update Microsoft used to have base and extension tables for each entity. e.g.

  • entitynameBase
  • entitynameExtensionBase

e.g.

  • accountBase
  • AccountExtensionBase

Here is some more information on the merging of tables, which explains how you can run the table merging as a separate job but you have to do it.

Run the base and extension table merge as a separate operation

I have written before about unsupported customizations before – Why you shouldn’t put unsupported customizations in Microsoft Dynamics CRM.  The primary reason you should avoid unsupported customizations is if you have to escalate an issue to Microsoft they offer limited support if you have unsupported customizations (because those customizations might be the cause of the behaviour/bug)

New functionality in CRM SDK and CRM

Usually (but not always)

  • Roll ups contains fixes
  • Service packs contain fixes and new functionality

New functionality doesn’t usually break anything but sometimes existing functionality might change.

The key point is the CRM SDK will have changed,

Old CRM SDK functionality depreciated

With one hand Microsoft giveth new functionality and the other hand they take functionality away (depreciate).

You should always read the What’s new for a new release of CRM – Why you should read the What’s new for developers because it lists not only the new functionality but includes what’s being depreciated in Javascript and CRM SDK.

Applied patches but stuff not working

I applied the rollup to CRM 2013 SP 1 rollup 3 but when I tried to test CRM, I noticed I was getting unusual errors.  The core functionality of CRM was working but I was getting errors when the plugins triggered calls to WCF web services.  Below is the error

The Web Service plug-in failed in OrganizationId: 3666c2e6-04f4-e411-80c9-000c292122be; SdkMessageProcessingStepId: 2ccabb1b-ea3e-db11-86a7-000a3a5473e8; EntityName: incident; Stage: 30; MessageName: Create; AssemblyName:
Inner Exception: System.TypeLoadException: Could not load type ‘System.Runtime.CompilerServices.ExtensionAttribute’ from assembly ‘mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′.
at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)

To find this error I had to turn on tracing and look into the event logs because CRM was not giving much information.

I have highlighted the key part of the error.

This article was useful

Could not load type ‘System.Runtime.CompilerServices.ExtensionAttribute’ from assembly ‘mscorlib

This seemed a classic DLL type error, this usually occur when you there are differences between .NET versions or DLL’s deployed.

In this particular scenario I could compare the .NET version installed on the working CRM environment and the .NET version and other DLL’s in the new upgraded environment.

So I needed to check the .NET version, Microsoft has a great page on this

How to: Determine Which .NET Framework Versions Are Installed

Be careful because you have to read it carefully.  I was checking the .NET versions in regedit (full instructions in the link above) and the folder said v4.  I was expecting a 4.5 folder, so I assumed it was version 4.

Its a better to know facts rather than making assumptions particularly when trying to find a problem.  In the example above I assumed the .NET versions where the same, which meant I then wasted time investigating other parts of the server and DLL’s looking for potential problems.

If I had read the article more carefully  it more carefully I would have noticed this very important section

The value of the Release DWORD indicates which version of the .NET Framework is installed.

 

The folder will be v4 but if this has been updated it will have a new Release registry value and the number in this registry settings tells you what version of .NET is installed

.NET versions

 

I found there was a DWORD value in the working CRM Server which indicates I had 4.5.1 installed

378675.NET Framework 4.5.1 installed with Windows 8.1 or Windows Server 2012 R2

I checked on the server I was updating CRM 2013 SP 1 to rollup 3 and it only had .NET framework 4

What was happening was the web services were compiled with .NET 4.5 but when they tried to run on the new server it couldn’t find the correct dll versions, this caused the odd errors.

What I learnt

Don’t make assumptions – Know don’t assume.

If web services are not working check the .NET versions and look for the secret DWORD registry setting Release.

 


Filed under: CRM 2013, rollup

Is Gamification in a Microsoft Dynamics CRM a gimic?

$
0
0

To answer the question in the title, Microsoft certainly doesn’t think so because they have just acquired FantasySalesTeam.

Microsoft Acquires FantasySalesTeam, an Innovative Sales Gamification Platform, to Help Organizations Increase Productivity

I will warn you this blog post is the Hosk thinking out loud, it doesn’t really go anyway but I thought I would share my thoughts on the subject.  I will add I haven’t used a gamification system yet but there usage is on the rise so maybe it’s a matter of time.

Core CRM

When I think of the core concept of CRM

Customer

Relationship

Management

It strikes me as feeling a bit old fashioned and slow moving when you consider the fast paced world of social media, twitter, instant messaging, the OMNI channel.

some of the benefits of a CRM system is having one source of data which multiples teams and individuals in an organization can use and leverage to effectively do their jobs.

CRM system give workers access to knowledge which can often be tucked away in individuals computers/heads/folders/documents.

CRM system can automate procedures

CRM systems can unify lots of desperate excel spreadsheets, bespoke software, different software all under one new CRM system.

CRM systems are

  • Information
  • People
  • Processes

What is gamification?

Here is a good definition of gamification

Gamification is the concept of applying game mechanics and game design techniques to engage and motivate people to achieve their goals.[1] Gamification taps into the basic desires and needs of the users impulses which revolve around the idea of Status and Achievement.

The main concept is making parts of process into a game and encourage competitive behaviour.

This sounds fun and funky but at it’s core you are measuring workers contributions with a score based system.  The purpose of the employer is to encourage the competitive instinct of your workers and encourage them to obtain more points.

Monitor

The monitoring and measuring (against co workers) seems a bit mean and possibly sinister but the reality is your bosses already compare your performance against your peers and this is traditional how pay rises are allocated, so it’s nothing new or something to fear.

Teaching

The game elements interest me because when you play any computer games the points system teaches users how to become more effective at the game and how to get more points through action and the award of points.  It encourages innovation of processes and techniques to game (improve) the system and get more points.

Know who is effective rather than feel

One of the beautiful concepts of gamefiction is it can show you who are the most effective workers rather than using the often unscientific and potentially flawed method of opinion.  gamification makes companies assess the processes they go through and add value to those processes, it makes companies analyse what they do.

Fun

Would gamification make work more fun? hmmm I find this hard to believe but badges and points can motivate people in funny ways.

When the Microsoft Dynamics Community brought out new badges the gamer in me was urged to obtain them for seemingly little reward (does anyone care I have most of the badges is anyone impressed?)

Check out the Dynamics leaderboards here

Learn about Dynamics Community Badges here

I’m sure there are many people who have played a computer game on their computer/tablet/games system in order to get a power up, badge or level up, staying up late and depriving themselves of sleep to get it.

Incentives

Gamification tries to tackle the conceptive of incentivisation.  Are your workforce incentivised to work harder.  When I worked on a helpdesk in one of my first jobs, people were not incentivised to work harder and answer more helpdesk queries because

  • If you solved a query you were rewarded with more queries to solve
  • No one was measuring how many bugs/queries people solved
  • no one was rewarded for working harder.

Sales people are usually one of the few areas of the business who are incentivized to work harder due to commission based pay (e.g. you sell more you get more commission).

Games can be gamed

Games can be twisted by players to get more points.  If a company was using this system for dealing with incidents.  It could lead to players waiting for easy incidents to get more points rather than dealing with the incidents from the most important customers or priority cases.  I imagine there is a balance needed to reward the players but get the focus of the game aligned correctly.

Not all tasks are equal

The problem  with gamification is some tasks help everyone but the effect can be hard to calculate, not all tasks are created equal.

  • setting up shared information
  • automating processes
  • delivering letters

If sometimes necessary tasks are worth less points people will be less inclined to do them because of the opportunity cost (e.g. they could be doing a task which could get them more points).

Companies would need to think carefully about the rules of the game and possibly insist on a bit of turn taking.

Facts

Reading the interesting article mentioned at the start of this article

Microsoft Acquires FantasySalesTeam, an Innovative Sales Gamification Platform, to Help Organizations Increase Productivity

The facts quoted are impressive

  • Service Corporation International (NYSE: SCI) recently ran a pilot with 130 sales reps and compared their performance to almost 700 others. Those using FantasySalesTeam on average closed 88% more deals at 213% the average contract value.
  • Wireless Zone saw a 176% increase in total sales, 35% increase in specific product sales and a 9% increase in profit in the first month they ran FantasySalesTeam.

It would be fascinating to see the stats of the most successful sales people in terms of phone calls, emails, meetings in comparison to the least successful.  What are the more successful sales people doing, implementing gamefiction will not only highlight the most productive but give you a template as to what other workers need to do to emulate them.

Summary

Gamification is looking at the processes of a companies Microsoft Dynamics CRM system and trying to motivate people to use it more effectively.

I’m fairly certain it could make things more fun (who doesn’t like bettering their fellow workers) and reward people who are working effectively.

Interesting and I look forward to seeing how Microsoft will integrate the new company.

If anyone has any experience with Microsoft Dynamics and gamification please leave a comment I would interested to hear your experiences.


Filed under: CRM 2011, CRM 2013, CRM 2015

Thoughts on CRM Design and converting user requirements to CRM solutions

$
0
0

Just because you can, doesn’t mean you should – Hosk

I was working on a CRM 2013 project and then a CRM 2011 urgent bug came in and I had to open up CRM 2011 to investigate the problem, s I opened up CRM 2011 and navigated to the system settings I was struck how easily and quickly I could navigate to system settings in CRM 2011 compared to CRM 2013.

CRM 2011 was about a second quicker but the user experience is CRM 2013 seems more frustrating as you wait for menu’s to drop down and then have to scroll right to get to admin.

CRM 2013 looks better than CRM 2011 and selling it to potential customers is easier.

The other point I notice about CRM 2013 navigation was how much more thinking I had to do when using it, you have to be precise with the top menus and if you lose concentration the menu hides itself which causes extreme frustration to users.

CRM 2011 had the propensity to pop up lots of windows, each link you clicked opened a new window, which sometimes led to you have loads of IE windows.  There are two ways to look at this behaviour

  • A problem
  • A benefit

With my CRM developers hat on, I liked the ability to have multiple windows open and find CRM 2013’s one window behaviour very frustrating.  Developers like multiple monitors and multiple pages of CRM open at the same time.

The problem with lots of CRM 2011 windows poping up is it was sometimes difficult to find the window you wanted but if you turned on tabs then I found this manageable.

I’m not sure users like multiple windows and if we assume CRM developers are power users, who like to have lots of advanced finds and windows open, we have to consider this might not be the way end users use the system but it would be nice to have the option of having windows pop rather than one window functionality.

I assume the one windows and navigation is tangled in with Microsoft’s windows 8/everything is a tablet view of the world.

CRM 2013 and CRM 2015 go down the one window policy.  The one window functionality makes navigating CRM confusing because I find myself asking questions

  • How do I get back to my previous page
  • What should I click
  • What was my previous page
  • How do I jump to System Settings

Causing the user to think to much when navigating is often caused by poor design

Good CRM design should not make users think

After reading the excellent book  Don’t Make Me Think!: A Common Sense Approach to Web Usability, this book made me change the way I view CRM form design and I would recommend all CRM developers to read this.

Users thinking about navigating is a good summary of why I find CRM 2013 navigation difficult.

CRM 2013 made finding the advanced find difficult, which is particuarly frustrating for CRM developers who love the advanced find – Why the advanced find is a CRM Developers best friend

How did the CRM 2013 design come about

I have often wondered how Microsoft came up with the CRM 2013 navigation that was obviously slower and more difficult to use.

CRM 2013 design would be great for tablets but how many users use tablets/phones with CRM 2013/2015 and tablets/phones have their own app so why does the core CRM navigation need to change.

consider the CRM 2013 navigation and what it does well

  • It looks great
  • It makes the most use of space (by hiding menu options)

The two features above come at a cost

  • Frustrating and difficult to use
  • slower to navigate

I imagine most people use Microsoft Dynamics CRM on a desktop/Laptop with a monitor so space on the CRM form might not be the highest priority but ease of use and speed are certainly something all users would value.

There are no easy choices when designing, CRM developers often have to make choices when designing forms.  To increase loading speed you need to hide grids and some data on the form load and you need to find the right balance between information and performance.

CRM 2015 SP 1 – Onwards and upwards

I used CRM 2015 SP1 last week with a new CRM 30 day trial and the new navigation improvements are fantastic.  My personal opinion is this what the navigation should have been like in CRM 2013 SP1.  The current navigation feels as fast and intuitive as CRM 2011 but looks better.

CRM 2015 new nav

This type of navigation can created in CRM 2013 by using this

The new CRM 2015 navigation reminds me of this great CRM 2013 tool One Click navigation which I reviewed on my blog

If you are using CRM 2013 this blog has a great collection of bookmarklets to allow you to quickly jump to certain areas in CRM.

Great collection of bookmarklets

http://devbeard.com/even-more-bookmarklets/

I like the get Guid bookmarklet and the bookmarklet which makes all fields readonly (already this has saved me a bunch of time).  These bookmarklets will work with CRM 2015 as well

Converting requirements to CRM solutions

The CRM 2013 menu design is a good warning to all CRM developers, all the choices we make creating a CRM solution have benefits and drawbacks, finding the correct mix to suit your customers requirements is difficult skill.

As a CRM developer you will often need to translate the user requirements into a technical CRM solution, this needs you to have an open dialogue  with the end user about the drawbacks of certain customizations and how this fits in with tasks they need to do in their job.

CRM developers need to user their experience to advise the end users and there may be some situations when you need to tell the users their idea is not a great idea (in a nice way of course)

I have seen CRM solutions where users insisted on something being done in an completely inefficient/daft way, only for all the customizations to be removed later when performance was terrible.  Creating CRM solutions is a partnership between users and CRM developers which work best when both sides are contributing rather than one side dictating.

Example

I worked on a CRM project where the new CRM solution was slower and took more clicks than the old software it was replacing.

I wondered how it had got to this stage, how was a slower system created.

Possible Reasons

  • The business analyst focused on what information should be collected
  • The business asked for more information to be collected
  • Little thought to automation

The system was tested and proven to work OK in the test environment but when it was put live with time constraints the system proved to be slower and was effecting the output.

The CRM solution had to be optimized and workflows, plugins and javascript was used to automatically set fields where appropriate but the change in working practices and extra data needed to be input was a manual interaction which couldn’t be worked around.

The extra data being captured came with a time cost

 


Filed under: CRM 2011, CRM 2013, CRM 2015

Hosk’s Top CRM Articles of the week – 10th August

$
0
0

Article of the week

CRM 2015 Custom Alerts and Popup Dialogs in JavaScript

Great article on creating custom popups in Microsoft Dynamics CRM.  It’s unsupported but this is a common requirement and this solution is very neat and tidy.

CRM

Using CRM from an external website – part 2: research

Good article looking at CRM integration with external websites

Testing CRM rollups and .NET versions

Hosk had problems testing CRM and it was all down to the .NET version

My CRM project failed because of lack of user adoption. Really?

Some good advice on CRM projects, make sure there is a reason

Is Gamification in a Microsoft Dynamics CRM a gimic?

A look at gamification in CRM.  Hosk blog

Hardcore CRM: Do a major upgrade of a plugin version!

I haven’t used versioning in plugins very often, although I have often wished we had.  I didn’t realise you could end up with different versions of the same plugin deployed

Thoughts on CRM Design and converting user requirements to CRM solutions

Hosk blog on CRM design and solutions

New XrmToolBox plugin : Chart Manager

A great new tool in the XrmToolBox

CRM 2015 – plugin deployment options

There are lots of options when you deploy a plugin, learn what they are

Tip #449: CRM Online Trial Setup – Update

When setting up your CRM trial make sure you click the “IT FOR DEV” button and hopefully Microsoft won’t ring you up trying to sell to you

Using “People” as a currency in CRM

It sounds dodgy but it’s creating a new currency in CRM called people, NOT buying and selling people

useful analysis of Parature and CRM integration

A look at the current parature and CRM integration.

Build and Deployment for Microsoft Dynamics CRM

building and deploying CRM

programming

Self forming teams at scale

Doing Terrible Things To Your Code

Other

Why smart meters matter

Tesco To Remove Ribena, Capri-Sun & Other Sugary Drinks From It’s Shelves

Seven Leftovers You Should NEVER Reheat (As This Could Poison Your Family)

Two Forms of Human Motivation: Gain And Prevent Pain

How Walking in Nature Changes the Brain

The Checklist Manifesto: How to Get Things Right

A Dozen Things Charlie Munger has said about Reading

great article on evolution from the BBC

5 Books That Will Change Your Life

Intel and Micron Produce Breakthrough Memory Technology

Previous top picks

Hosk’s Top CRM Articles of the week – 24th July

Useful Hosk Links

Hosk list Of CRM 2013 Tools

A list and review of CRM 2013 tools, this will probably work in CRM 2015 as well

Hosk’s CRM Developer Articles

A collection of my favourite CRM Developer articles I have written

MB2-703 – CRM 2013 Customization and Configuration Certification Information

All the CRM 2013 content to help you pass the exam

HoskWisdom – Hosk Developer Quotes

 Words of Wisdom from the Hosk.  I have written over 900 articles, surely I should have said a few memorable things


Filed under: Hosk’s Top CRM articles of the week

Why understanding abstractions can help you write better code

$
0
0

I have been a developer for many years, working with APL, Java, Javascript and C# and I considered myself a decent programmer (doesn’t everyone?)

I had read articles on the S.O.L.I.D principles

I had a decent grasp of OO design principles and understanding Polymorphism, encapsulation, abstraction and inheritance.

I used interfaces and abstract classes but it was only recently that I understood some of the benefits of abstraction with regards to code design.

This  understanding has come through reading (re-reading in some instances) various parts of the book mentioned below

  • Code Complete 2
  • Clean Code
  • Head First Design Patterns
  • Design Patterns – Elements of Reusable Object-Orientated Software
  • S.O.L.I.D design principles

Head First Design Patterns mention these design principles, which I found really useful to understand the effects of good OO design

  • Encapsulate what varies
  • Favour composition over inheritance
  • Program to interfaces, not to implementations
  • Strive for loosely coupled design between objects that interact
  • Depend upon abstractions. Do not depend upon concrete classes

Knowledge is like a jigsaw puzzle

I had read some of the material a long time ago, on my recent reading I found my initial understanding of some of the concepts was lacking a bit of understanding.  This isn’t unusual when trying to understand complex and abstract concepts, here is an interesting article on that phenomenon.

When learning new ideas and concepts you can get a partial understanding where bits of it are clear, whilst other areas can be fuzzy.  I view information/ideas as having a 3D property where it suddenly makes sense when you view the information/idea from a different perspective.

This article talks about the metaphor as knowledge as a jigsaw puzzle

Your understanding grows as more pieces of the puzzle fall into place

What is Abstraction?

Before looking at abstraction from a coding point of view what is a general definition of abstraction, Wiki has a few definition

http://en.wikipedia.org/wiki/Abstraction

Abstraction in its main sense is a conceptual process by which general rules and concepts are derived from the usage and classification of specific examples, literal (“real” or “concrete”) signifiers

Conceptual abstractions may be formed by filtering the information content of a concept or an observable phenomenon, selecting only the aspects which are relevant for a particular purpose. For example, abstracting a leather soccer ball to the more general idea of a ball selects only the information on general ball attributes and behavior, eliminating the other characteristics of that particular ball

Abstraction – Computer Science

In computer scienceabstraction is a technique for managing complexity of computer systems. It works by establishing a level of complexity on which a person interacts with the system, suppressing the more complex details below the current level

When abstraction proceeds into the operations defined, enabling objects of different types to be substituted, it is called polymorphism. When it proceeds in the opposite direction, inside the types or classes, structuring them to simplify a complex set of relationships, it is called delegation orinheritance.

 

Code Complete 2 gives a clear definition of what an abstraction is

abstraction is the ability to view a complex operation in a simplified form.  A class interface provides an abstraction of the implementation that’s hidden behind the interface

What is an abstraction?

Abstractions are used regularly in everyday language, we use abstraction when talking about lots of things, such as
 
  • Chair
  • Table
  • Computer
  • Mobile Phone
These are abstract ideas which everyone understands but people don’t have a mobile phone, they have an exact make of mobile phone but most people don’t talk about the exact type by the abstract type of mobile phone.
 
Mobile phones have some core data
 
  • Ringer
  • Screen
  • buttons
  • Mic
  • Speaker
A mobile phone would be a good case for a Abstract class which could be inherited by a real instance which may add more features.

Why is understanding Abstraction important

Abstractions help hide concrete code which can change with abstractions such as interfaces and abstract classes which are less likely to change.

Using abstraction limits dependencies in code, reduced dependency means reducing the effect of change in your code.

Two of the key long term goals for developers when writing code

  1. Increase the readability of the code
  2. Minimise dependencies in code, reducing the effects of change

The two goals will make maintaining the code easier, below I talk how abstraction can help you to achieve those goals.

Junior developers seem reluctant to use abstractions in code because of a mixture of not understanding how abstractions work and because they are focused on getting the code working and bypass the creation of abstractions, which can lead to big complex methods, few classes and no abstractions.

Junior developers are focused on the short term goal of getting the code working with the intent of leaving the design and creation of abstractions until later (later often doesn’t come).

Which leads me to write articles like the two below

 

Understanding Abstraction

Abstraction is one of the key principles behind many of the OO design principles such as

  • Inheritance
  • Polymorphism
  • Composition
  • Benefits of abstraction
  • Code is easy to understand
  • Manages change and the effect of chnage
  • Creates cohesive code – it finds common fields
  • Create loose coupling

Abstraction refines concepts to their core values, stripping away ideas to the fundamentals of the abstract idea.  It leaves the common details of an idea.

Abstractions make it easier to understand code because it concentrates on core features/actions and not on the small details.

My understanding started to grow whilst reading these two OO design principle

  • Encapsulate what varies
  • Program to interfaces, not to implementations.

The various books and articles concentrated on the benefits of these two design principles I start to understand how abstraction could reduce dependences and the affect of changes on code, you can see I started thinking about whilst writing this article Information Hiding.

How to find abstractions?

In the blog post  How to find classes I talked about how to find classes, finding abstractions is a similar exercise.  Common abstractions are
  • Nouns – things, people, systems
  • Verbs
  • Types
  • Behaviours
  • Is A – Inheritance
  • Has A – Behaviours

Actions/Verbs are often abstractions e.g. Drawing, validating, processing, routing.

When I mention types I am referring to

Abstractions are useful in life

People use abstractions all the time, you often mention 

  • Computers
  • Chairs
  • People
  • Cars

You don’t talk about the distinctive type of car but say car in general and people will understand you what you are talking about.

The same idea can be used in your code design.  You can find a common action like validating, drawing, Updating, exceptions.  The common action will be the interface and the concrete classes can hide behind it.

Exceptions are a good example you have a core exception (the ones lazy programmers throw when they don’t want to specify the exact error) and then distinctive exceptions extend it.

Exception is the abstraction and InvalidPluginExecutionException , NullReferenceException etc are the implementing concrete classes.  

Examples

I had some code where which was triggered on the change of state and depending on certain values it would be go a different route, there were lots of different routes

The abstraction was Route, I made this an interface and it was then implemented by many different Routes through the system.  If the users wanted more routes the code was made to encapsulate what varies.  

Half the code used the interface Route, any changes by adding more routes would mean the code which used the interface would need to change or be effected by the change.

Why Abstractions are so important

Abstractions help create well designed code.

The code is easy to understand because if you have captured the right abstractions is obvious what the code is doing.

Abstractions help create loosly coupled code.  The reason is the abstraction acts like a type and encapsulates the potential changes behind the abstract class/interface.  

To understand why this is import you need to understand the statement

code to an interface, not a concrete class.

A classic abstraction is creating a database layer, an abstract class or interface which parts of the code users to interact with the database. The abstract minimises the effects of change because the code which interacts with the interface will not be effected by the implementation/concrete class changing.  It also allows the code to change in the future and more types being added.

Adding more types will not effect any code which interacts only with the interface.

This brings me nicely to the design principle

Encapsulate what varies

Business rules or algorithms are a good example.  When you have a behaviour or type you have an Abstraction.  Using an abstract class will manage the effects of change and create a loosely coupled system which will manage the effect of change.

Understanding abstraction can take time

Abstractions are used everywhere because they make life easier

  • Common language
  • S.O.L.I.D principles
  • Design Patterns
  • Design Principles

It was until I began to understand the terms Encapsulate what varies and Code to an interface that I slowly (very slowly) could see how abstractions made it easier to organise code/reduce dependencies and how abstractions through abstract classes and interfaces helped manage the affects of change.

Change can ripple through poorly designed code because poorly designed code is fragile, you change one part of it and an unrelated part of the code suddenly breaks.  The reason for this sudden breaking is dependency.

Abstractions (interfaces/Abstract classes) reduces dependencies and the abstraction acts as a barrier to dependency and change.

The next stage of my personal appreciation of abstraction was when writing the blog post – How to find classes, the method of looking and finding classes through nouns and types made it easier for me to identify potential abstractions.

Studying design patterns and good code will help you to understand and learn how great code uses abstractions.  The two books below are great books to get started with design patterns, my vote goes to Head First Design Patterns because it’s easier to get started with.

Summary

Abstractions are a handy tool to understand when designing your code, it can make maintaining code much easier because you will improve readability and reduce dependencies in the code.

It’s definitely time well spent understanding abstractions in code design and it will make designing code easier.

Understanding abstractions can make you look at your existing code base from a different perspective because the potential abstractions highlight where the code might change in the future and areas of potential refractoring.

 


Filed under: Code, Hosk CRM Dev, OO Design

CRM 2015 – How to decompile a plugin Assembly (DLL)

$
0
0

This blog post looks at how to decompile plugin code because I had a problem recently where I needed to do it.  The process will work in all version of CRM because fundamentally it works at DLL level rather than CRM level.

It’s a useful to understand because there are some instances where you need to know what code has been deployed because it might be different from the code you have or the code in your source control.

The problem – Why isn’t my fix working?

A bug fix I had deployed and tested in our dev environment and test environment suddenly stopped working when deployed to the customer environment.

This isn’t an unusual problem but an annoying one for developers.

Don’t assume, know

When bug fixing and testing try to avoid the trap of assuming because assumptions are often wrong, resulting in missing the obvious source of the problem, spending time testing other possible reasons for a problem.

Usually when a bug fails on a different environment I want to recreate it in the DEV environment where I can easily debug it.
For this problem we have two internal instances

DEV
TEST

I tested my fix in DEV and it seemed to work and then I tested the fix in internal TEST environment and found my fix didn’t work, why?

Finding the plugin code deployed

There are instances when you need to find the code deployed in a plugin. It’s possible to version plugins but CRM developers don’t bother versioning their plugins and I currently don’t version the CRM plugins.

Plugins can be versioned in the same way solutions are version in CRM

major.minor.build.revision

You need to think about versions and solutions because when you change the major number of a plugin assembly CRM considers it a completely different plugin assembly

Microsoft has a good article on Plugin Assembly

This article on how to upgrade version

Hardcore CRM: Do a major upgrade of a plugin version!

What to do if you don’t use assembly versioning

The problem I had was how could I tell what code was inside the plugin and if my fix was deployed?  The code in TFS (Source Control) was correct and up-to-date but I tested the functionality and could see it wasn’t working.

I decided to download the plugin assembly dll and decompile the code.

The tools I used was

XRMToolbox

Go to releases and click latest release if you want to download the application not the source
https://github.com/MscrmTools/XrmToolBox/releases

The XRMToolbox has a tool called Assembly Recovery Tool. This tool allows you to connect to a CRM instance, it loads all the assembly DLL’s (which can some time), you can choose to download any of the Plugin assemblys(dll file). This will give you the dll, which you can decompile using a different tool.

Once you have the DLL file you can decompile the dll using a tool such as

ILSPY

There are lots of other decompilers out and the main reason I use ILSPY is because its free

To use the decompiler you open it up, select a DLL or copy one to the application, below I have selected a HoskCRMDev2013 plugin.  The dll’s in blue are dependant plugins

decompile plugin

If you then click on one of the methods, it decompiles the code, which you can view it in the yellow right hand screen.

decompile plugin1

ILSPY has a few neat options to save the to file.

A few notes on decompiling DLLS

DONT decompile DLL’S you or the company you work for doesn’t own because basically you are viewing the source code.

I’m not sure about the legality of it but it’s probably illegal, particularly if you don’t own the intellectual property.

If you aren’t sure if you should decompile a DLL think about it like this.  If you went to the owner of the source code and asked to view the source code, would they let you?

A common cause of decompiling plugins/custom workflows is to see what has been deployed if plugin versioning is not used.

Be warned decompiled code is slightly different, often the variables don’t have the same name.

If you are concerned about your dlls being decompiled there is a tool to encrypt them, I haven’t used it.  The discussion on StackOverflow is a good place to start if you are interested

Protect .NET code from reverse engineering?

When might you need to decompile a DLL?

Surprisingly there are quite a few scenarios where you might need to decompile a DLL, I will go through some of the common scenarios but the

Lost source control

I have seen scenarios where a company has lost the source control for code which has been deployed.  Often its old legacy systems and most people who worked on the project have left the company

Deployed with source control checked out pending

A developer deploys some code, forgets to check in the code.  The developer then might leave the company, go on holiday and can’t be contacted.  You need to know what code has been deployed and what code might not be checked it.

Plugin won’t deploy from CRM Developer toolkit

Sometimes a plugin won’t deploy and you will get an error like this

Error registering plugins and/or workflows. Plug-in assembly does not contain the required types or assembly content cannot be updated

The reason for this error is often because the deployed assembly file (DLL) is different.  It might have an extra step and you are not updating the file but trying to replace it.  CRM doesn’t like this.

I had an example of this recently and there was an additional step in the deploy DLL.  I used the plugin registration tool to compare the steps but I wasn’t sure what was in the extra step.  So I download the DLL and looked at the code.

What has been deployed

This is the problem I was experiencing for this bug.  I needed to check if the code deployed was the same as the code in source control, the only way I could do it was to decompile the code and compare.

Plugins without versioning

A common cause of decompiling plugins/custom workflows is to see what has been deployed if plugin versioning is not used.

Multiple Developers Versus Source Control

When you have multiple developers working on a project, source control can sometimes lead to problems with people not getting the latest code and deploying an older version

Who deployed the different plugin?

I was wondering how the different plugin version got deployed. I wondered if I could work out what solutions were imported

I remember review a useful tool a while ago the Solution History tool, which is a tool which works with the XRMToolbox

You can download the tool here

The tool usefully told me what solutions had been imported and what files were included.

I could see the solution had been changed and who imported but I couldn’t tell what version of the Plugin Assembly had been deployed.

This tool would be extremely useful if the project you are working on imports multiple solutions without changing the version number.

What gets updated when you import a plugin to the database?

In the background when you import a plugin it updates system entity called plugin. I wondered if I could select these entities to see when they had been updated.

The problem is you can’t select system entities in an advanced find, so I remember another tool which works with the XRMToolBox the FetchXML Builder

You can get the tool here

This tool is useful because it has GUI interface to allow you to create Fetch XML queries. This means you can select system records.

The real beauty of this is you can create FetchXML queries and then use them in your plugins.

I wanted to use the tool to easily query the system entity of plugin

retrieve plugin

Which produces the FetchXML below

<fetch count ="50 " ><entity name ="pluginassembly " >< filter>< condition attribute= "name" operator=" eq" value ="Full Assembly Name " /></ filter></entity></fetch>

This allowed me to retrieve when the plugin was changed and by who. I was wondering if someone had directly deployed a plugin to the Test environment and bypassing the Solution import phase but it turned out not to be the case.

I couldn’t work out who had deployed an old plugin version and the important point was I had the resolution to the problem (although you would like to be confident it wouldn’t happen in the future)

Summary

This blog should show you how to download and decompile a DLL file.  There are certain scenarios where you aren’t sure if the code deployed is the same as the code in your source control.

Downloading and decompiling DLL’s is another tool to put in your development bag, make sure you use it for good not evil.


Filed under: CRM 2011, CRM 2013, CRM 2015, Development, plugins

Hosk’s Top CRM Articles of the week – 19th August

$
0
0

Article of the week

Dynamics CRM 2015 JavaScript Form Notifications on Steroids

Great article on how to beef up the notification in CRM by using the solution provided for free on codeplex.  Those boys at Magnetism are a great bunch

call workflow in CRM 2015 easily from Javascript

I really liked this article as well

Best Of the Rest

CRM 2015 – How to decompile a plugin Assembly (DLL)

Hosk blog post talking about how to decompile a plugin assembly and more importantly when and why you might need to do this.

Gamifying Sales Comp

It’s all about the games you can play to motivate your CRM users at the moment, even I wrote a blog post a couple of weeks ago Is Gamification in a Microsoft Dynamics CRM a gimic?

Replicate Right Click behavior of Dynamics CRM Grid on Custom Grids

Interesting article about adding right click behaviour

Why understanding abstractions can help you write better code

read the article and find out why?

Adding JavaScript to Quick Create Forms in CRM 2015

how to isolate the quick create form in and write JavaScript just for it.

looking at CRM performance issues

Always good to know about performance issues before your CRM suffers from them.

Sample code to check if User is a member of a team C# CRM 2011/2013/2015

Simple but useful

Building not in queries in advanced find

A classic requirement

Angular with TypeScript

Pluralsight have a training course on Angular with TypeScript which is a dream for Dave Berry

Tips & Tricks for debugging unfamiliar AngularJS code

indepth article looking at debugging AngularJS, I haven’t seen any CRM projects use AngularJS yet but it might only be a matter of time.

Workflow ExecutionTimeSpan

good article because it shows some creative thinking, whilst teaching you about the underlying data in CRM.

Multi select field for Dynamics CRM 2013/2015

I haven’t needed a multi select for quite a while but I remember when it use to crop up all the time.

A free customizable Editable Grid for Dynamics CRM 2013/2015!

Does what it says

programming

Is Egoless Programming still relevant?

When Does DRY Become ARID?

Excellent article on the factory pattern using warriors and wizards.

how to become a better coder overnight

How Good Developers Deal With Bad Code

15 Ways To Write Beautiful Code [That Have Nothing To Do With Testing]

Other

Mental Model: Misconceptions of Chance

Lenovo preloaded laptops with reformat-resistant perpetual crapware

How To Be Loved By Everyone: 6 Powerful Secrets

The Science of Obesity

4 Tips to Boost Your Creative Thinking Skills

Schopenhauer: On Reading and Books

Previous top picks

Hosk’s Top CRM Articles of the week – 10th August

Useful Hosk Links

Hosk list Of CRM 2013 Tools

A list and review of CRM 2013 tools, this will probably work in CRM 2015 as well

Hosk’s CRM Developer Articles

A collection of my favourite CRM Developer articles I have written

MB2-703 – CRM 2013 Customization and Configuration Certification Information

All the CRM 2013 content to help you pass the exam

HoskWisdom – Hosk Developer Quotes

 Words of Wisdom from the Hosk.  I have written over 900 articles, surely I should have said a few memorable things


Filed under: CRM 2011, CRM 2013, CRM 2015, Hosk’s Top CRM articles of the week

CRM 2015 – How to diagnose plugin errors

$
0
0

This blog talks about a plugin error which I have seen a number of times when using the Plugin Developer Toolkit, it will discuss how to diagnose plugin errors in general.

Before I talk about plugins can I encourage people to vote on the connect item to get the CRM Developer toolkit working with Visual studio 2013, if you can’t wait for Microsoft to fix it then read my blog post CRM Developer Toolkit Alternatives

Hosk CRM Brain

I like to think of my blog as my CRM brain uploaded to the internet, so whilst reading this you are currently crawling through my CRM brain.  This allows me to search my CRM brain when my real brain forgets how I resolved a problem, actually sometimes I even forget I have experienced a problem and get pleasantly suprised when I have found not only did I have the problem before but I blogged the solution.

The benefit of me blogging about CRM is I benefit and other people who read and search my blog.

My goal in writing articles focused on errors is not only to write about how to resolve the issue but additionally look into the cause of the problem and , the WHY.

Knowledge helps when things go wrong

There is always a difference between theoretical knowledge and practical knowledge.   You can learn the theory of something but find it’s different when you try to use the theory in practical use (e.g. after reading about plugins you then try to write a plugin) you there are gaps in knowledge which you quickly find.

When developers start to plugins they usually go through

  • learn to write plugin code, find lots of errors
  • try to deploy plugin, error haven’t signed the plugin, error permissions etc.
  • Slowly but surely the developers experience fewer problems or problems they know how to resolve

Indepth knowledge of how Microsoft Dynamics CRM works and the underlying plugin infrastructure becomes extremely important when things go wrong.  When errors appear and hold up development, developers need to understand the cause of the error but why it’s complaining, the answer is usually understandable if you understand

  • how the CRM developer toolkit works
  • The various parts of the CRM Developer toolkit
  • The CRM plugin execution framework
  • The roles and privileges needed to deploy plugins

Some useful Hosk Plugin blog posts

The CRM developer toolkit is great (which is why I get annoyed it hasn’t been updated because it automates a lot of the repetitive actions needed to deploy a plugin using the plugin registration tool.) but I feel CRM Developers should learn how to use and deploy plugins using the plugin registration tool.

I use the plugin registration tool to inspect what plugins and steps are deployed and the ability to change the view to see what plugins are deployed for each entity is really useful when investigating bugs on CRM solutions you are not familiar with.

Most of the time you don’t want to mix using the plugin registration tool and the CRM developer toolkit because the CRM developer toolkit will overwrite the changes you make manually next a developer uses it to deploy CRM customizations.

The plugin registration tool is great for viewing the plugins deployed and its portability allows you to use it in customer environments.

If the CRM Developer toolkit gets in a mess you might need to use the plugin registration tool to quickly update or deploy a plugin whilst you fix the plugin developer toolkit.

I had an error previously but the problem was the CRM developer toolkit had got out of sync and I struggled to resolve this problem.  You can read about my frustrations with the CRM Developer toolkit

Dealing with Plugin errors

If When you experience a plugin error I would recommend you first read my blog on common problems because I cover the most common errors.

If you don’t find the answer then stop and think about the potential cause of the problem.  Many developers can go into a mild panic mode when they encounter an error, instead of logically thinking about the problem they instantly go and get a senior developer to help them.

Then when the senior developer is at their desk, they explain the problem.  The process of explaining the problem to the developer, the solution to the problem can become clear.  This is known as rubber ducking or I call this Cardboard developer

When you encounter a plugin problem or CRM developer problems

  1. Stop
  2. Engage Brain\Think
  3. What’s happening?
  4. What should happen?
  5. Make a list of the possible causes of the problem
  6. Investigate your list

If you can’t resolve the problem, you can then at tell the developer what you know, what you have tried.

I don’t encourage any developers to suffer in silence but it’s more beneficial for you own personal learning if you try to understand and resolve problems yourself.  The major benefit of trying to resolve the problem yourself is you get in the habit and become less dependent on the help of your colleagues.

Don’t Assume, know

Don’t Assume, Know is a Hosk mantra I tell myself when investigating problems or debugging.  I have wasted many hours investigating problems and looking for solutions based on an incorrect assumption.  When dealing with problems don’t assume anything, check assumptions and cross them off.  Lots of times you will find the problem.

Plugin Error Messages

The error messages Microsoft Dynamics CRM throws are a mixture of a confusing statement with a nugget of truth tucked inside.  To developers new to CRM development they are just unhelpful messages.

As your experience and knowledge of CRM development increases you will find they often point you in the right direction but you need to have built up a map of the CRM landscape, so you know where to go and check.

Plugin Error Example

This is common error I have experienced a few times but I was trying to deploy a plugin using the CRM developer toolkit and I got this error

Error registering plugins and/or workflows. Plug-in assembly does not contain the required types or assembly content cannot be updated.

Lets break down the message to try and decify the problem

  1. It can’t register the plugin/workflow
  2. Plugin Assembly does not contain required types or the assembly cannot be updated.
  3. So we know the plugin assembly (the DLL) exists but it cannot update it.

The first thing to do is know not assume.  So I opened the Plugin Registration tool and found the DLL.  I could see it had three steps.

I then looked at the RegisterFile.crmregister file and found this had two steps.

The problem was because we were trying to update an assembly with 2 steps but the assembly had 3 steps.  It couldn’t update the assembly because it was too different and this error message was letting us know (in a slightly confusing way).

I have experienced this problem before and the solution to the problem is to unregister the Assembly and install it again.

This problem has occurred when I have created new plugins and sometimes when I have updated a plugin maybe in a different solution but for some reason I couldn’t update the DLL.

In this case how the extra step got into the assembly was a complete mystery but it’s OK to delete the plugin assembly because I knew I was going to deploy it again and install a new version of the Plugin assembly.


Filed under: CRM 2015, Development, Hosk CRM Dev, Hosk’s Microsoft Dynamic CRM Development, plugins

Hosk’s Top CRM Articles of the week – 24th August

$
0
0

Article of the Week

a good example and justification of using access teams to share record

A great post to help understand when and why to use access teams.  I wrote a brief article on access teams for CRM 2013 – MB2-703 – Access Teams and Access Team Templates how to use them and key facts

Why Use Access Teams in Dynamics CRM 2013

Initially I wasn’t sure the purpose of Access teams but the article above and this excellent article from Adam Vero should help you understand the concept.

CRM 2013 – Why are access teams marooned?

Oddly there isn’t a way to export the configuration for access teams, which means you have to recreate them.  This is another case of a Connect issue raised years ago and mainly ignored (Is Microsoft Listening to the Dynamics CRM Community?)

Console app for moving CRM Access Team templates

Luckily there is a console application which can copy the CRM access team templates written by Lucas Alexander.

Best of the Rest

CRM 2015 – How to diagnose plugin errors

Hosk blog with advice on how to diagnose Plugin errors

Using CRM from an external website – part 3: Stage one “Web API”

The series continues linking CRM with an external website.

Adding Custom Button on Security area in Dynamics CRM 2015

Ever wondered how to add a custom button to the security, nope me neither but it doesn’t you won’t have to do it in the future.

summary of all the import privileges

How to enable and disable users from importing and exporting in CRM

CRM 2011 – Javascript to set the current date and time

JavaScript showing how to set a CRM field to the current data and time

CRM UI Testing using Dalek

Interesting article on writing UI Tests for CRM, I will admit to never having heard of Dalek before.

What are the limitations of Microsoft Dynamics CRM Online and how do you work with them?

When you write customizations for CRM online you need to think differently

Use SQL Tracing to find the SQL query generated for Dynamics CRM Platform Operations for CRM On-Premise

Match your CRM queries to SQL queries, very useful.

New Localizable Attributes in Dynamics CRM 2015

Very useful

Looking at upgrade approaches

Things to consider about upgrading CRM and keep up with releases, rollups and service patches.

Using Microsoft Power BI Desktop to build Dynamics CRM Online reports Part 2

Hmmm Power BI seems pretty darn good.

programming
Why Software Development Time Estimation Doesn’t Work and Alternative Approaches

Why KISS isn’t easy

More Agile, More Problems

other
teaching is important as anything else

thinking small with Malcolm Gladwell

breaking the mold

8 MASTER STRATEGIES FOR PUBLIC SPEAKING

The Jerry Seinfeld and John Grisham Productivity Hack

Previous top picks

Hosk’s Top CRM Articles of the week – 10th August

Useful Hosk Links

Hosk list Of CRM 2013 Tools

A list and review of CRM 2013 tools, this will probably work in CRM 2015 as well

Hosk’s CRM Developer Articles

A collection of my favourite CRM Developer articles I have written

MB2-703 – CRM 2013 Customization and Configuration Certification Information

All the CRM 2013 content to help you pass the exam

HoskWisdom – Hosk Developer Quotes

 Words of Wisdom from the Hosk.  I have written over 900 articles, surely I should have said a few memorable things


Filed under: CRM 2011, CRM 2013, CRM 2015, Hosk’s Top CRM articles of the week

CRM 2015 – Why is the System user shown as disabled in the plugin registration tool

$
0
0

Someone asked me why the System user had the word disabled in brackets in the plugin registration tool when editing plugins and can we I still use it.

I have set plugins to run as SYSTEM but I couldn’t remember if the SYSTEM user had disabled in it. I fired up the plugin registration tool, selected a plugin, clicked the Run in User’s Context and found this

System User Disabled

I wasn’t sure whether I should be worried about the disabled or not, had it always been there?

In this example the CRM developer was setting a plugin to run as the SYSTEM user because the plugin need to run with more security privildges than the calling user.

To learn about Impersonation and plugins read my blog post

CRM 2015 – Understanding impersonation in plugins and knowing when to use it

What is the SYSTEM user

My knowledge of the SYSTEM user is it’s a super super in built user which you cannot see inside CRM in any of the views, the SYSTEM user won’t appear in disabled or enable user views inside CRM.

SYSTEM user is used by plugins, workflows to run with elevated privileges and when the user updates any records you will see SYSTEM.

Gonzalo Ruiz has written a great blog post on the SYSTEM and INTEGRATION

Explaining the built-in SYSTEM and INTEGRATION users

The blog post has a few interesting points to consider

  • Nobody can log in CRM as either of these 2 users.
  • These users are always on the root business unit.
  • No security applies to these users (any action is allowed when executing as SYSTEM or INTEGRATION), all security validations are bypassed.

I’m guessing the SYSTEM user shows this SYSTEM (disabled) to indicate the user is disabled from user CRM as a general user.

Why is named SYSTEM (disabled)?

SYSTEM (disabled) lets the CRM developer know they are selecting the special SYSTEM user and not a user created user who could also have the name SYSTEM.

I did check some other CRM instances (CRM 2011, CRM 2013 and CRM 2015) to see if SYSTEM always had SYSTEM (disabled) and in the three instances I looked at all had the words disabled in brackets after the SYSTEM user.

I’m not sure labelling the system user as disabled is the best idea because it caused concern we had somehow disabled the SYSTEM user or maybe we shouldn’t select it because it was disabled.

It seems it’s just Microsoft Dynamics CRM having a quirky way to indicate the SYSTEM user is special and not to be confused with other non super users (surely there is a better way)


Filed under: CRM 2011, CRM 2013, CRM 2015, plugins

CRM 2015/CRM2013 – JavaScipt to get the current users name

$
0
0

This blog post will show you a quick way to get the name of the user using JavaScript.

Where you might use this functionality

This functionality is useful because you might need to update a User lookup field to a particular user in situations like

  • The current user changed a key field
  • The current user is primary contact for a project, account, deliverable.
  • Set a text field of the users name for reporting purposes.

Why are you mentioning it

To do retrieve the current user name in CRM 2011 it took a soap call to retrieve the user name field using the Xrm.Page.context.getUserId().  Below is a blog post I wrote

CRM 2011 – Setting a user lookup with the logged in user with Javascript

There is now a much easier way to do this in CRM 2013 and CRM 2015.  I found this way whilst reading this forum post

crm 2013: javascript get attributes from other entity in Contact Form

Start with the CRM SDK

The Hosk CRM developer mantra is to always start with the CRM SDK to see what methods and functionality exists which can help.

Searching the CRM SDK first helps you see what functionality Microsoft have added, most CRM developers will be surprised the number of new methods added.

It’s very easy for developers to copy and paste existing code in projects but just because it works it doesn’t mean its the best code to use.

This is classic case, the CRM 2011 code is long and involves a soap call, the new functionality added in CRM 2013 allows you to access the data with one line.

Microsoft Client code page – Client-side context (client-side reference)

There are three useful functions about the existing user (there’s another about language but I’m not including it).

getUserId
Returns the GUID of the SystemUser.Id value for the current user.
getUserName
Returns the name of the current user.
getUserRoles
Returns an array of strings that represent the GUID values of each of the security roles that the user is associated with or any teams that the user is associated with.

 

Xrm.Page.context.getUserId()

This would get you the SystemUser.Id

Xrm.Page.context.getUserName();

This would return a text string of the user name

Setting User lookups

The common reason for retrieving the user name and the user id is because both values are needed if you want to programatically set a lookup field in CRM.

Example code is shown below


var setUservalue = new Array();
 setUservalue[0] = new Object();
 setUservalue[0].id = Xrm.Page.context.getUserId();
 setUservalue[0].entityType = 'systemuser';
setUservalue[0].name = Xrm.Page.context.getUserName();

Xrm.Page.getAttribute("LookupField").setValue(setUservalue)

Alternatives

In the requirement I was working on I used JavaScript because I needed to set a field dynamically and instantly.  Other CRM customizations may have different requirements and you could set the lookup field using a Plugin or a workflow.

What I have learnt

  • Use the CRM SDK to see what functionality exists, there might be a better way
  • Microsoft added a new getUserName method in CRM 2013
  • You need the guid, name and entity type to set the value of a lookup field
  • If you don’t need to set the lookup instantly you can use workflows or plugins
  • CRM forum posts provide extremely useful information from a number of CRM developers

 


Filed under: CRM 2011, CRM 2013, Javascript, JScript

Microsoft Cloud Certification could allow complex CRM solutions to go online

$
0
0

Complex customizations can be difficult to implement in CRM On-line instances, so the announcement from Microsoft this week offering cloud certification offers a route complex CRM solutions can now be done in the cloud.

Microsoft Announce Cloud Certification

Bob Stutz wrote an interesting and potentially very significant blog this week

Cloud Certification now available for Microsoft Dynamics CRM

The blog post seemed to slip under the radar of the Microsoft Dynamics CRM community, producing little discussion or retweets, which I found surprising.

A possible reason for the muted response could be the title of blog post, using the term Cloud Certification doesn’t make the subject of the article clear.  The term cloud is completely overused, my default response is to ignore articles with the term cloud in them.

If I have understood the article correctly Microsoft are offering the customers the option of deploying an On premise CRM in Microsoft Azure environment and run Microsoft Dynamics CRM using Microsoft Azure infrastructure services.

This is like a having a private cloud or your own personal CRM Online and this seems very interesting because it allows customers not to have buy servers and licences, host CRM in the cloud/Online but have more control over Microsoft Dynamics CRM.

Why is this CRM private cloud different from CRM Online

I often read Microsoft Dynamics CRM online is making great strides and Bob Stutz in the article mentions

Last quarter we reported that CRM Online revenue nearly doubled

Microsoft Dynamics CRM Online improvement helped Microsoft wnin the CRM Magazine market leader award

Microsoft Dynamics CRM wins CRM magazine Market Leader awards

Microsoft CRM Online is great for smaller companies (save money on servers and licences) and CRM solutions without complex customizations.

My experience with CRM online is when the CRM customizations become complex and a CRM solution has a lot of customizations a CRM online implementation can become extremely difficult.

The limitations of CRM Online makes the On Premise a better choice for complex CRM solutions (which makes it puzzling why Microsoft delay features to CRM On Premise, why punish those users).

A question mark over large CRM implementation (large in terms of data and users) to CRM online because the cost of the database on a monthly basis could prove expensive and performance could be an issue (exactly how are resources shared between CRM organisations online).

There are a number of good blog posts describing the differences between CRM online and CRM On Premise

Comparing CRM On-Premises to CRM Online

Microsoft Dynamics CRM – Online vs. On Premises Decision Matrix

Complex CRM solutions not being the best choice for CRM online maybe just my experience.  Most of CRM projects I work on are based On Premise but this could most of the projects I work on need lots of CRM customizations and these are better suited to CRM On Premise.

CRM Online needs a different attitude towards customizations

The blog post below is regularly in the daily most read blog posts on the Hosk CRM blog

What are the limitations of Microsoft Dynamics CRM Online and how do you work with them?

I don’t believe CRM developers have adapted their solution design to deliver complex CRM customizations using Microsoft Azure and other Online

The limitation of CRM online (summarized from the blog post above)

  • No Indexing
  • Increasing performance – How?
  • Data privacy
  • Restrictions of sandboxed plugins
  • No Custom ASP.NET pages
  • Reports are FetchXML

These limitations means CRM customizations written for On Premise solutions won’t work with CRM Online.

To deliver complex CRM solutions CRM developers will need to learn and user Microsoft Azure and Microsoft Azure Services but I am yet to read an article featuring CRM Online and Microsoft Azure (even from Microsoft) which leads me to believe not many CRM developers are doing this………yet.

Cloud Certification offers an alternative

Cloud certification seems like a confusing way of saying private cloud, which could be a great choice for many CRM projects and subsequently this is potentially importantly a significant offering from Microsoft.

Cloud Certification advantages

  • Complete control over the IT environment
  • No Limitations on customizations (no limit on workflows, no sandboxed plugins)
  • No need to buy physical servers and licences (but you will need pay for Azure licences)

The Cloud certification offers potentially the best of both worlds, complex CRM solutions, full control over IT environment and data but without having to host CRM on your own servers.

Potentially?

I have used the word potentially because I’m not sure I have understood quite how it will all work and I have some questions

Customers are a single click away from being deployed in the cloud

I have never known anything happen easily and with one click, particularly CRM development.  Who knows what is really involved in moving a CRM project online?

Why is no else talking about this?

I haven’t read many articles talking about Cloud Certification, which makes me wonder if I have understood it clearly.  It seems to suggest a private cloud type offering but is that what really means.

Perhaps the Hosk is quick off the mark!

What’s the catch?

There is always a catch, it might be using Azure services involves customizations being rewritten, I honestly don’t know because my experience with Azure is a free trial.

What’s the real cost?

The article mentions a new special licence Dynamics Lifecycle Services (LCS) but the licencing model for Microsoft Dynamics CRM seems to be getting more confusing with each new release.  I live in fear someone asking me what licences they will need!!!

In the article Bob states

In my conversations with customers, I am hearing very positive feedback for this self-hosted option as they have shared that it’s a ‘great fit with our strategy’. Customers that need to remain on premises like the flexibility that they can start to take some advantage of the cloud by putting a test environment on Azure.

This isn’t appealing to customers but CRM suppliers and definitely CRM developers would think this is a great offering which will allow highly customised CRM solutions to be deployed in the cloud.

One interesting point to consider is Microsoft have a 99.9% uptime gaurantee.  This sounds great consider the potential downtime each year

SLA level of 99.9 % uptime/availability gives following periods of potential downtime/unavailability during the specified period (cf. below):

  • Weekly: 10m 4.8s
  • Monthly: 43m 49.7s
  • Yearly: 8h 45m 57.0s

I’m sure there was a time recently when CRM online was down for a couple of hours at a time.  If you had a critical system then a downtime of 8 hours a year could be significant but most CRM solutions don’t need to be up all the time.


Filed under: CRM 2011

Hosk’s Top CRM Articles of the week – 1st September

$
0
0

Article of the week

Announcing CRM DevTools for CRM 2015 and Update 1!

This brilliant tool for Chrome has been updated.  Not only is this a great tool but even if you don’t use the tool it points out lots of functionality built into CRM which can allow you to debug and investigate CRM.

The tool is free.  Three cheers for Sonoma Partners

Microsoft Cloud Certification could allow complex CRM solutions to go online

I’m putting my blog post here this week because I want to know readers opinions on the new Cloud Certification Microsoft has just starting offering.  Moving On Premise CRM to a private cloud with one click!

best of the rest

CRM 2015 – Why is the System user shown as disabled in the plugin registration tool

System user is show with disabled in brackets, find out why

How to build an Agile Inspired Project Management XRM Solution in less than a day with Microsoft Dynamics CRM

A great example of how you can quickly create a solution using Microsoft Dynamics CRM

Tip #457: Get your icons here

Get yourself some free icons for your custom entities

CRM 2015/CRM2013 – JavaScript to get the current users name

Javascript to get the current users name

You Too Can Snoop… But Not In A Creepy Way

Fantastic solution to allow you to get information on your plugins

Dynamics CRM 2015 – Top 5 Developers Delights

The inogic’s top five posts on new features for CRM Developers in CRM 2015 update 1

Tip #459: Don’t touch that file. Or that one. Or this one.

If you have edited the CRM web.config beware you may have trouble in the future

Standard and Enhanced SLAs in Microsoft Dynamics CRM 2015: How To Maximize Your Usage

Some help to understand CRM SLA’s

Why the advanced find is a CRM Developers best friend

The CRM advanced find is awesome, find out why

Cloud Certification now available for Microsoft Dynamics CRM

Cloud certification available

understanding plugin sandbox mode

Understand Plugins in sandbox mode

Explaining the built-in SYSTEM and INTEGRATION users

There are two special and hidden system users in CRM, find out more

CRM 2015 – CRM developers should think in Entities

Think in Entities CRM Developers

What Makes A Good CRM Consultant?

What are the qualities of a good CRM consultant

Come Clean With Your CRM Data

Clean your data

A Day in the Life of a CRM Admin

Q&A with a CRM Admin

Programming

How to be the Fastest Developer on Your Team, Part 1

Great article on 40-year-old lessons and the Mythical Man-Month

The mythical Man month is free to download, awesome

a quick summary of the The mythical Man month

Other

Do we need Windows 10?

Rich People like to read

10 Things Productive People Do Before Bed

Intel Inside… literally?

Brains Sweep Themselves Clean Of Toxins During Sleep

Why do some people refer to themselves in the third person? 

Previous top picks

Hosk’s Top CRM Articles of the week – 24th August

Useful Hosk Links

Hosk list Of CRM 2013 Tools

A list and review of CRM 2013 tools, this will probably work in CRM 2015 as well

Hosk’s CRM Developer Articles

A collection of my favourite CRM Developer articles I have written

MB2-703 – CRM 2013 Customization and Configuration Certification Information

All the CRM 2013 content to help you pass the exam

HoskWisdom – Hosk Developer Quotes

 Words of Wisdom from the Hosk.  I have written over 900 articles, surely I should have said a few memorable things


Filed under: Hosk’s Top CRM articles of the week

Hosk’s Top CRM Articles of the week – 14th September

$
0
0

I have been on holiday for a week at the awesome Butlins, I had a great time but boy was it tiring.

I saw Scooby Doo, Mike the Knight, Angelina the Ballerina and Katie from Cbeebies, went on rides, danced, playdoh, bubbles, saw a castle and went to the beach.

Here are my Mini Hosk’s having fun

IMG_20150909_091319

Article of the week

editable grid in CRM? here are the choices

Sometimes customers will want an editable grid, this blog posts goes through some of the options.

best of the rest

Overcoming Multi-Level Rollup Field Limitation

Codeless solutions can sometimes be tricky.  This blog posts gets round the rollup field limitation of you can’t reference a rollup field in a rollup field.  Codeless solutions sometimes can involve using code other people have written in a free solution!

Set Address using Lookup Address for locked Address fields in Dynamics CRM

Setsubmit and dirty fields can cause headaches for CRM developers because CRM only updates fields which are dirty (dirty means changed).  This blog post above shows how they got round the problem.

I would also suggest reading my blog post

CRM 2011/2013 – What does setSubmitMode do? and how does it work?

creating a Codeless Opportunity Payment Schedule in CRM

A codeless solution from the king of the no code solutions Leon Tribe.

CRM 2015 – how to find Statecode value

How to find the statecode value for an entity

Microsoft Dynamics CRM Browser Compatibility

Browser compatiablity is a problem which can sneak up on CRM upgrades, makes sure you know what internet browsers you can use.

Dynamics CRM Outlook Synchronization: How it Works – white paper

Outlook synchronization is great when it works and terrible when there is a problem.  Read this white paper to learn what’s going on under the hood

CRM 2013 – How add a status reason using the CRM SDK

You can use the CRM SDK to create status reasons and set the int number used

solution simple questions

This blog answers some of the common questions about solutions. I also recommend reading Hosk blog posts

Modifying Click-To-Call Hyperlink Properties for CRM 2013 Phone Fields

Setting click to call hyperlinks on some system fields, involves a bit of tinkering.

CRM 2013 – Plugins – Simple update plugin – Redeploying, improving and updating

Step by step guide to updating a plugin

Lock/Unlock Composite fields using Java Script in Dynamics CRM

Expanding Field Label Widths in CRM 2015

Expanding field labels is not straight forward (like many things in CRM), find out how

How to Avoid Code Complexity?

Great post on how to avoid code complexity, something I am always trying to avoid.

On a similar subject read my two blog posts on the subject

Programming

Code Review – The Ultimate Guide

About Clean Code

Code Watch: The first four habits of highly employable developers

Other

Roughly 100 Fantastic Pieces of Journalism

How Germany abolished tuition fees

critical thinking

3 words to revolutionize the world

Get it Done: 35 Habits of the Most Productive People (Infographic)

The AI Revolution: The Road to Superintelligence

The Ten Most Important Books To Expand Your Brain

Simplify Your Life

Previous top picks

Hosk’s Top CRM Articles of the week – 24th August

Useful Hosk Links

Hosk list Of CRM 2013 Tools

A list and review of CRM 2013 tools, this will probably work in CRM 2015 as well

Hosk’s CRM Developer Articles

A collection of my favourite CRM Developer articles I have written

MB2-703 – CRM 2013 Customization and Configuration Certification Information

All the CRM 2013 content to help you pass the exam

HoskWisdom – Hosk Developer Quotes

 Words of Wisdom from the Hosk.  I have written over 900 articles, surely I should have said a few memorable things


Filed under: Hosk’s Top CRM articles of the week

Why CRM Developers should always start with the CRM SDK

$
0
0

The CRM SDK is the main tool for a CRM developer and the better a CRM developer knows its capabilities, limitations and documentation the more efficiently they can do their job.

CRM developers should always start with the CRM SDK, it contains all the functionality needed to work with CRM, yet many developers rarely look in the CRM SDK documentation for clarification/help usually turn to the internet to look for examples.  Retrieving code examples results in a missed opportunity to learn about the CRM SDK.

What is the CRM SDK?

There is the actual CRM SDK, which you download Microsoft Dynamics CRM Software Development Kit (SDK) for CRM Online and on-premises CRM 2015 This gives you a bunch folders and files with sample code and the all important CRM dll’s and maybe a link to the CRM developer toolkit as long as you haven’t downloaded CRM 2015 (Where is the CRM Developer toolkit for CRM 2015?)

CRM SDK download

When I mention the CRM SDK, I am talking about primarily about documentation which describes the functionality contained in CRM dll’s.  In the download it’s the CrmSdk2015.chm, I use the online documentation because it’s easier to search.

Software Development Kit for Microsoft Dynamics CRM The CRM SDK documentation is awesome but I distinctly remember finding it difficult to use when I was learning CRM development.

I talk more about the CRM SDK in this blog post and it’s a good place to start learning about it

This is my CRM SDK

In the film Full Metal Jacket Gunnery Sergeant Hartman tells the recruits to give their rifles a name because it’s their best friend and could save their life (he actually says give the rifles a ladies name because they won’t be getting their hands on any ladies for a long time).

CRM developers should view the CRM SDK as their development rifle.  It’s your best friend and your main tool in CRM development and it will save you development life on numerous occasions with the it’s functionality and features.

Gunnery Sergeant Hartman: Pray!
Recruits: [chanting] This is my rifle. There are many others like it, but this one is mine. My rifle is my best friend. It is my life. I must master it as I must master my life. Without me, my rifle is useless. Without my rifle, I am useless. I must fire my rifle true. I must shoot straighter than my enemy, who is trying to kill me. I must shoot him before he shoots me. I will. Before God I swear this creed: my rifle and myself are defenders of my country, we are the masters of our enemy, we are the saviors of my life. So be it, until there is no enemy, but peace. Amen.

Most CRM developers aren’t allowed guns at work because in times of frustration it would be too tempting to shoot their computer but each CRM developer will have his own copy of the CRM SDK (for each version of CRM).  I have adapted the quote to make it more suitable for CRM development

CRM developers: [chanting]

This is my CRM SDK. There are many others like it, but this one is mine. My CRM SDK is my best friend. It is my life. I must master it as I must master my life. Without me, my CRM SDK is useless. Without my CRM SDK , I am useless.   I must development with my CRM SDK true.  I will.

Before Hosk I swear this creed: my CRM SDK and myself are defenders of my CRM Solution, we are the masters of the CRM Solution, we are the saviours the CRM Solution. So be it, until there is are no bugs, but peace in CRM dev land. Amen.

CRM Development is like a jigsaw puzzle

I view CRM development as a jigsaw puzzle, like a jigsaw puzzle CRM development contains many different but connected pieces.

Learning and understanding the different pieces often helps see how the other pieces of the jigsaw fit together.

A couple of examples could be

  • Learning about plugin architecture can help understand how workflows, real time workflows work and why plugins are quicker.
  • Understanding  SetSubmitMode in Javascript and how does it works can help you understand update plugins are only passed the values of fields which have changed, so in order to get other fields you need to add an image.

Learning new skills is a mix of theoretical (reading, videos, etc) and practical (doing).  There is a different between theoretical knowledge and practical knowledge, which occurs when you try to get the sample code to run and have to fix many  small problems before it works.  Whilst fixing these problems you learn how things really work.

Theoretical knowledge without practical experience has a limited value because until you write some code or create a customization you can’t be really sure you know how to do it.

Practical knowledge without theoretical knowledge is more useful but this can be a slow way to learn, involving making lots of mistakes and learning best practices through action.  Problems and errors can be harder to diagnose and fix if you lack the theoretical knowledge and understanding of how the CRM SDK works.

The above section is the long way of saying CRM developers should read the CRM SDK documentation.

CRM developers and the CRM SDK

The CRM SDK is the supported/safe way to interact with the Microsoft Dynamics CRM database.  Just like an annoying family member you are stuck with it and every day you come to work you are going to have to work with CRM SDK.

The CRM SDK can be stubborn, difficult and renowned for not suffering fools gladly

The CRM SDK is a cruel mistress to those who do not show it respect but if you play nicely and tickle CRM SDK’s belly it will deliver untold development riches

One of my common quotes  regarding CRM development is

Always start with the CRM SDK

You cannot work around the CRM SDK

My advice to CRM developers who are thinking about creating unsupported CRM customizations is don’t even think about it.

If you put unsupported CRM customizations into your CRM solution Microsoft will not support your CRM Solution.

Do you want to the person who has to inform the customer you cannot get support for a CRM problem (which could be a bug in Microsoft Dynamics CRM) because you wrote an unsupported CRM customization.

There are other reasons why you should put unsupported customizations in

  • Upgrading CRM will be harder
  • Unsupported customizations could stop working with any rollup or patch
  • Microsoft won’t support the CRM Solution

Read more reasons Why you shouldn’t put unsupported customizations in Microsoft Dynamics CRM

How some CRM developers work

Most developers when faced with a task they are not sure about will look for some sample code to use.  The common places to get some code are

  • Internet search
  • Hosk’s Dynamic CRM Blog
  • Existing code
  • Ask a question on the CRM forums
  • Ask a fellow developer how to do it
  • Look at the SDK

Most developers view development

  • Code
  • Debug
  • Test
  • Repeat

Learning through experience is a valid way to learn but it can be a slow way to learn, where the developer has to make all the mistakes themselves and remember to learn from them.  Reading the CRM SDK will help you understand how CRM customizations work and avoid some of the errors/mistakes.

The CRM SDK documentation contains the limitations of functionality, it’s vital to know the limitations of the functionality to avoid it causing problems when you find out later a certain piece of functionality can’t be used.

Examples

  • Plugins have a 2 minute time out, if you have some long running C# code then this needs to be done as a custom workflow.
  • Rollup fields cannot reference other rollup fields.
  • Business rules can’t reference values from other entities, JavaScript could be a better choice.
  • Workflows are Asynchronous, if you need the customization to run synchronously you need a real time workflow or a plugin.

Strive to understand how CRM SDK works

I encourage CRM developers to always start with the CRM SDK and to see what functionality is available and to increase your understanding of how the CRM SDK works.

Getting code examples is great but it bypasses the learning involved in creating the code yourself.

All craftsman should know their tools, a CRM developers main tool is the CRM SDK.  CRM developers should know the CRM SDK forwards, backwards, upwards, downwards and inside out. A CRM Developer should know the CRM SDK better than members of his family

You can view the CRM SDK as a family member

  • It’s troublesome
  • Can be extremely annoying at times
  • CRM SDK can bring you great joy
  • You have no option (supported option) but to get on with it
  • It’s constantly changing and evolving
  • It can be difficult to understand what it’s saying (confusing error messages!)
  • You love it

Why should you learn how the CRM SDK works

The better you understand the CRM SDK and the CRM platform the more in depth your understanding will be of the different customizations available for CRM developers.

CRM SDK knowledge is extremely useful in finding and diagnosing bugs, particularly tricky/subtle bugs.  I have seen bugs which involved plugins, workflows and Javascript overwriting the same fields.  Understanding how the different CRM customizations work with regards to synchronously and asynchronously helped me diagnose the problem

Error messages don’t tell you the problem but often point you in the right direction.  If you have studied the CRM SDK this will make sense, if you haven’t error messages can be extremely confusing.

In my blog post CRM 2015 – How to diagnose plugin errors it details plugin errors and how CRM SDK knowledge helps when things go wrong

Why you should read the CRM SDK what’s new

The CRM SDK has detailed sections on the new functionality for CRM developers and what functionality has been depreciated.

This article explains why you should read the what’s new

CRM 2015 SDK – Why you should read the What’s new for developers

here is my blog on the new functionality in CRM 2015 SP1

What’s new in CRM 2015 SP1 for developers, customizers and admins

CRM MVP’s

In 2014 I managed to persuade/pester many of the CRM MVP’s to fill in a Q&A which you can read here

One common trait in CRM MVP’s is they have a detailed knowledge of CRM and the CRM SDK and this knowledge comes through in their in depth blog posts.

Continuous Learning

My aim each day is to know more about CRM development when I leave work than when I started it.


Filed under: CRM 2013, CRM 2015, CRM SDK

Understanding levels of abstraction to improve the design of your code

$
0
0

The right level of abstraction in coding helps your code become easier to read/understand and bringing consistency and a logical design to your code.  When you see the right level of abstraction used it intuitively seems right.

Getting the correct level of abstraction is creating a consistent level of design in your code.

Understanding Abstraction

Understanding Abstractions in code design is difficult and takes repeated attempts at learning the concepts.  It’s worth persevering with because abstractions play a key role in code design and two important concepts of good code design

  • Encapsulate what varies
  • Code to an interface not a concrete class

To get started with abstraction in code design and understand the benefits read my blog post below

Why understanding abstractions can help you write better code

The right level of Abstraction

There are many articles/books which mention the concept of getting the level of abstraction right in your when designing code but not many of them explain the concept clearly.

To know if you understand something you should be able to explain it someone (or yourself) in simple terms don’t understand it well enough.

Albert Einstein

I found the concept of the right level of abstraction difficult to understand until I read a great section on exceptions in Code Complete 2.  The chapter described defensive programming and exception handling.  Below I will go through a similar example found in the book.

When you choose to pass an exception to the caller, make sure the exception’s level of abstraction is consistent with the routine interface’s abstraction

If I had a class called car with a method to return the engine size


Class Car{

Public GetEngineSize() throws ArrayTypeMismatchException

}

Calculating the engine size if all the correct fields aren’t set the code throws an ArrayTypeMismatchException, so the code throws this error.

Now ask yourself the question, is this exception the right level of abstraction?

The calling code doesn’t need to know the detailed error about arrays or type conversion errors.  Instead the calling code is more interested in data is not available.

The right level of abstraction would be improved with this error

Public GetEngineSize() throws CarDataNotAvailable

The calling function level of abstraction is concerned about the Car data, the original error message was at a lower level of detail.  The lower level of detail is the correct error to the concrete car class which implements the code logic, it’s useful to know what type of exception is thrown because it might deal with different errors in different ways.

The interface is a higher level, Engine, wheels, colour.  Classes using the interface are only interested in problems with the data, not the actual error which caused the problem.

The benefits of getting the right level of abstraction are

  • The code feels right
  • The design of the code is logical and easy to understand
  • Consistency

Why should I care about the level of abstraction

Setting the right level of abstraction is one small part of the process of improving the design of your code to make it easier to maintain in the future.

Finding the right level of abstraction for your code is often done after the initial code has been written.

Creative writers have to edit their first draft, advice to writers is to give themselves permission to write a bad first draft.

Writing code is similar because the first draft of code is focused on getting the code working, delivering the required functionality.  Designing good code is an emerging process, which I discuss in this blog post

Unit tests are a vital part of emerging code design

Developers should refactor their code after the initial draft.  The initial draft usually gets the code to work (short term goal) further iterations should improve the code by

  • simplify the code
  • reduce complexity
  • Improve readability
  • Improve the naming of classes, methods and variables
  • reduce coupling by creating new classes and methods
  • Setting the right level of abstraction and putting code in the right place

Another similarity with writers emerges because hopefully we are removing unnecessary lines (and methods).  In coding terms fewer lines of code means fewer lines of code to maintain, debug and read.

The refactoring and improving the design of the code is a stage often missed out by many developers.  The code will still work the same so many developers don’t see the value of refactoring and improving the design of the code.

The code working as required is the initial requirement

Refactoring and improving the design fore fills the long term requirements of maintaining code once written, such as

  • Reading/understanding the code
  • Resusing code
  • Easier to debug
  • Easier to extend
  • Reduces the effects of change on the code

If you miss out the refactoring stage you will soon end up creating legacy code and technical debt.  Read the articles below for more information

Conclusion

Good development is as often making lots of small good choices and avoiding making mistakes. Each complex method/class you avoid writing should be replaced with something simple.  Putting code in the right place and getting the level of abstraction correct is one of many small good design choices.

If you add put together lots of good code design choices you will end up with good code.


Filed under: Hosk CRM Dev, OO Design

Hosk’s Top CRM Articles of the week – 21st September

$
0
0

Lets start with a quote

To forgive is to set a prisoner free and discover that the prisoner was you.

I have got two articles of the week this week (it’s a fluid system) and neither of them are really articles.

Article(s) of the week

CRM Developer Extensions v1.2.0.0

The alternative to CRM Developer toolkit created by Jasson Lattimer CRM Developer Extensions is improving rapidly.  If you wondering why this is important then read where is the CRM developer toolkit for CRM 2015 and CRM Developer toolkit alternatives.

CRM Developer extensions has added some great new functionality

  • 1 click deploy plug-ins and custom workflow assemblies from Visual Studio
  • 1 click deploy reports from Visual Studio without having to go through CRM
  • Added CRM TypeScript template
  • Web Resource deployer

Importantly this works with CRM 2015 and it’s free

Podcast of the week

CRM Podcast TypeScript and JavaScript with David Berry

When ever I read or hear Dave Berry talk about CRM or TypeScript I learn something new and this podcast is full of interesting views and opinions.  It’s quite a long podcast about an hour long

Below we have some more Dave information and Links

Dave Berry MVP Q&A

Dave also did a great Q&A, easily the funniest one

Dave has a great article on Typescript and CRM
Introduction to TypeScript for (Xrm) Developers

What is TypeScript and how does it work with CRM 2011/2013

This article is the one I wrote, it’s more an introduction to typescript and where to find some more information

Best of the rest

Why the advanced find is a CRM Developers best friend

The Advanced is awesome, find out why

Why CRM Developers should always start with the CRM SDK

Always start with the CRM SDK, it will help you learn new features and functionality.

Undocumented Useful Script Functions in Dynamics CRM

Microsoft has a bunch of inbuilt script functions used by Microsoft Javascript code.  You can use those functions in your own code, you do need to be aware this is unsupported and Microsoft could change the Javascript at any moment

Just because everyone is talking about CRM 2016 don’t forget CRM 2015 Patch

There is a new CRM 2015 patch

Understanding levels of abstraction can improve your code design

Improve you code design and consider the levels of abstraction in your code

How to free storage space in Microsoft Dynamics CRM

Some great tips on reducing storage space on CRM online instances

Are your CRM plugins creating technical debt?

Is the way you write plugins causing technical debt in your CRM solutions?

5 Ways To Improve Microsoft Dynamics CRM Performance

Some tips to improve performance

Should you hire a Rockstar developer for your CRM project?

Do you want to put all your CRM development eggs in one basket?

Why you shouldn’t put unsupported customizations in Microsoft Dynamics CRM

Some reasons why you shouldn’t write unsupported customizations

Great Tool – OrgDBOrgSettings tool for Microsoft Dynamics CRM

Useful tool to tweak the CRM DB settings

CRM 2015 – How to Diagnose plugin errors

How to diagnose plugins errors, tips and good practices.

White Paper – Microsoft Dynamics CRM 2015 Performance and Scalability Documentation

Fantastic white paper on performance and scalability.

CRM and SQL Tip #01 – How to find out the Security Roles assigned to the user

SQL query to find security roles assigned to a user

13 signs your project is doomed

Signs you CRM project could be about to hit trouble.

Programming

Why Other Tech Talent Gets Paid More Than You by Lane Campbell 

The Myth of the Rockstar Programmer

good developers vs bad developers

Other

A Dozen Things I’ve Learned from Charlie Munger about Inversion (including the Importance of being Consistently Not Stupid)

4 easy ways to communicate more clearly in writing

I have 75k saved up in my bank account. I’m 24 years old. I want to generate passive income and retire by 30. What should I do with the money or how should I invest it?

Book Lovers Alert: 8 Of The Most Spectacular Libraries In The World

How netflix reinvented HR

Netflix slideshow on HR

Good introductory article on machine learning

28 ideas to become 5 times more productive

Elon Musk’s First Wife On What It Takes To Become A Billionaire.

Disney’s $4 Billion Steal

Previous top picks

Hosk’s Top CRM Articles of the week – 1st September

Useful Hosk Links

Hosk list Of CRM 2013 Tools

A list and review of CRM 2013 tools, this will probably work in CRM 2015 as well

Hosk’s CRM Developer Articles

A collection of my favourite CRM Developer articles I have written

MB2-703 – CRM 2013 Customization and Configuration Certification Information

All the CRM 2013 content to help you pass the exam

HoskWisdom – Hosk Developer Quotes

 Words of Wisdom from the Hosk.  I have written over 900 articles, surely I should have said a few memorable things


Filed under: CRM 2011, CRM 2013, CRM 2015, Hosk’s Top CRM articles of the week

CRM 2015 – Advanced find to return all enabled users with a security role

$
0
0

I had a requirement to find all the users who had a security role because I needed to update a value.

Advanced find is easy to find

I am a big fan of the advanced find and have been known to have many open at the same time

Why the advanced find is a CRM Developers best friend

In CRM 2013 Microsoft made it difficult to find the Advanced (Why Microsoft why?).  I often had to think how to find the advanced find which is a big no no in UX design (Good CRM design should not make users think)

The bad treatment of the advanced find caused one CRM developer to create a solution which added the advanced find to every record

CRM 2013 Tool – Advanced Find on record forms for CRM 2013

Security Priviledges

If you have users who don’t have security roles you will see this (annoying) message

Advanced find users with security roles 1

The common reason for the message above is due to users being added and not yet given any security roles, which is usually because someone forget or they are being lazy

Other reasons for users having no security roles is moving users between business units.  When you move a user between business units it removes all the security roles.

Sometimes CRM admins can take away user roles from a user rather than disabling them.  The user won’t be able to do anything.   Remember a users security privileges can come from Team membership, not only their individual security roles.

If you want to learn more about users and security roles, read this brilliant article from CRM MVP Adam Vero

Security Roles and Teams in CRM – An Inconvenient Half-Truth

For a brief overview of security roles and business units

Business Units and Security Roles

a list of limitations and rules of CRM security read my exam notes

 

Creating the Advanced find

This advanced find was straight forward, I wanted to search the User entity for users who had security roles.

I selected user record, adding a condition to the security role where it contain data.

Advanced find users with security roles

Advanced find limitations

You cannot do Not in queries with advanced find.  If the requirement was to find all the users who didn’t have any security roles, this would have been impossible to do in advanced find.

Hopefully the Not query functionality will be added to Microsoft Dynamics CRM and the good news is there is a connect item we can vote up (it has over 600 votes)

Allow NOT IN searches in advanced find, marketing lists etc

The bad news is it has been an issue since 2011.  I have noticed a growing number of issues raised in connect, going through the channels Microsoft recommends and the issues not being fixed.

In the blog post Is Microsoft Listening to the Dynamics CRM Community? I suggest Microsoft should revamp the connect system and process so they can utilize the feedback generated by the CRM community to improve Microsoft Dynamics CRM.  At the moment I feel the Connect website and process is to slow and isn’t working.

If you need the functionality now I have seen two customizations you can try using

Building “Not In” Queries Using Dynamics CRM Advanced Find

Performing Outer Join in Advanced Find

 

 

 

 


Filed under: Advanced finds, CRM 2011, CRM 2013, CRM 2015

What’s new in CRM 2016 and why you should read the preview guide

$
0
0

We keep moving forward, opening new doors, and doing new things, because we’re curious and curiosity keeps leading us down new paths.

Walt Disney

 

I go on holiday to Butlins for a week and Microsoft release a new version of CRM, well not actually release but an outline of what’s coming in CRM 2016 and the CRM community is vibrating with blogs, articles and general excitement of a new release.

There is a difference between theoretical knowledge and practical knowledge (a concept I talked about in this blog Why CRM Developers should always start with the CRM SDK), in a similar way there is a difference between functionality in the CRM 2016 preview guide and the functionality included in CRM 2016.

Working with Microsoft Dynamics CRM we must keep our eyes on the horizon scanning for new versions of CRM getting read to land

What is CRM 2016 preview

The preview document gives you a guide to the new features likely to be included in CRM 2016 but the features and functionality described in the preview document can be

  • Amended
  • Removed
  • New features added
  • Deprioritized

At this late stage it’s unlikely the functionality will change much but be aware functionality can change

New releases of Microsoft Dynamics CRM are exciting

  • There is always a new look and feel to CRM
  • Great new functionality for Sales men (like dashboards etc)
  • Useful new functionality for Developers
  • A bunch of Gotcha’s and limitations

The preview guide gives us a glimpse of the future, a road sign to help us anticipate the impact CRM 2016 will make.

The features might change but at least we have an idea of the new functionality and importantly what technologies or products are going to be used to deliver the new functionality.

Why you should read the CRM 2016 preview guide

The Scouts motto is be prepared, the handbook describes this in more detail

  • Be Prepared in Mind by having disciplined yourself to be obedient to every order, and also by having thought out beforehand any accident or situation that might occur, so that you know the right thing to do at the right moment, and are willing to do it.

The Scout’s had some good values because it’s not the first time I have used their advice.

Why you should write code and customizations like a boy scout

Being prepared allows you to survive but knowing the future functionality in CRM 2016 allows you to use this as an opportunity to take advantage by aligning your technical skills to the technology used to deliver the new functionality.

If you know what’s coming, you can position yourself to take advantage of it

Reading the preview guide you can see what functionality is coming, allowing you to prepare your skills and knowledge, enabling you to position yourself to start utilizing the new functionality.

Sometimes CRM developers can feel like Microsoft are constantly adding new features and not giving developers/consultants/solution architects time to get used to new functionality.

The reasons for reading the CRM preview guide are the same reasons CRM developers should read the What’s new for developers in the CRM SDK.

  • Knowledge
  • Start to prepare
  • Analyse the suitability of customizations for existing CRM projects
  • be prepared (Scouts motto)

There are some additional reasons you should  the CRM 2016 release notes

  • It’s not very long
  • you get an idea of what’s coming
  • a chance to see if anything exciting is coming
  • You can start to prepare
  • it’s decent CRM network conversation
  • Adjust your learning to focus on technology used in CRM 2016 (mobile, Azure Machine Learning, etc)

CRM Online customers

One aspect of CRM Online I found concerning from a CRM developers perspective is the process of updating the CRM version.  When ever a patch, service update or new CRM version is released the CRM customizations could stop working and you need to test ALL the customizations.

Testing all the customizations for complex projects can be take a lot of resources (people) and organising, so it’s important you are in control of this process.

Microsoft addressed this by allowing users to turn off the automatic updates but I’m not sure what happens for a new release or if you can turn off the updates indefinitely?

This technet article discussing managing CRM online updates (you have to approve the update)

Manage Microsoft Dynamics CRM Online updates

The document states updates are mandatory but you can have only one update per year

this update becomes mandatory and the customer will be required to take the update during the available dates for that particular release.

 

The thought of a CRM instance having to update to a new version causes my CRM developer heart beat to start racing.  Imagine if this happened to all the Microsoft Dynamic CRM projects I have worked on, this is another great reason for CRM developers not to write unsupported code

On the positive side this should make plenty of work for CRM developers, whilst they check their customizations work in the new release of CRM 2016.

CRM is constantly evolving

I view new release of Microsoft Dynamics CRM with excitement and In trepidation

It’s a wonderful world. You can’t go backwards. You’re always moving forward. It’s the wonderful part about life. And that’s terrific.

Harvey Fierstein

 

 

A CRM Developers life and CRM surroundings are constantly changing with major new releases coming once a year (new release or service pack update I classify as major release)

It’s exciting and sometimes tiring trying to keep up with change inside Microsoft Dynamics CRM.

CRM developers have new functionality to learn and master, CRM developers are constantly challenged.

CRM developers/CRM professionals need to work hard to keep up with the latest releases and functionality but with this difficultly comes opportunity.

With every new release of Microsoft Dynamics CRM you have the opportunity to become an expert in the new functionality, the go to person.

A key skill of the CRM developer is knowing what customization to use for a particularly customer requirement.  Microsoft Dynamics CRM is extremely versatile and required functionality can be achieved using different customizations but there is usually one type of customization which is ideally suited.

CRM developers know the different  versions of the CRM SDK and always start by referring to it

Key Information for the CRM 2016 Preview

The key information about the CRM 2016 preview can be found below

Release Guide link

Microsoft Dynamics CRM 2016 release guide

Microsoft Blog links

Microsoft reinvents productivity with upcoming release of customer engagement solution

Bob Stutz blog post

Microsoft Dynamics CRM 2016 – Delivering the Next Generation of Intelligent Customer Engagement

Release Date

Microsoft Dynamics CRM 2016 — in Q4 of this calendar year.  I find it amusing Microsoft can release CRM 2016 in the year 2015!

Microsoft Video Link

Microsoft Dynamics CRM 2016 Release Overview

Grand Quotes

I thought I would put some of the quotes, I love the idea of releasing quotes like this when I have created some code for a bugfix, maybe something like

“With this bug fix I have designed the code from the ground up to deliver the core functionality in one bug fix, which eliminates distractions and should dramatically increase customer productivity.  I have made field read only.”

Over exciting quotes from Bob Stutz and Microsoft

“We are eliminating the distractions people inevitably encounter when they bounce from application to application in the course of doing their job by taking away the need to export or switch applications, and by automating fundamental tasks.”

 

“Dynamics CRM 2016 is designed from the ground up to deliver core capabilities all in a single system to eliminate distractions, to make it easier to get things done, and to dramatically increase productivity so our customers can spend more time serving their customers.”

 

One quote from Microsoft press release

“The most comprehensive upgrade ever for Dynamics CRM includes advancements in intelligence, mobility and service, with significant productivity enhancements to help businesses and workers achieve more”

 

The direction of CRM 2016

Before looking at the functionality I want to highlight the broad direction of Microsoft Dynamics.

Microsoft have a clear hierarchy in platforms 

Cloud first, mobile second, on premise last

Microsoft’s policy of updating CRM on premise versions 6 months later definitely seems Microsoft’s way of gently persuading everyone to use the CRM online version.  I have talked about this before

What are the limitations of Microsoft Dynamics CRM Online and how do you work with them?

This seems a strange tactic because there are lots of reasons (data, complexity) why some CRM solutions are better suited to CRM On Premise.  Microsoft recently announced their Cloud certification to allow CRM on premise solutions to move to private cloud/Azure platform, which I blogged about here.

I’m don’t understand why Microsoft are making their current CRM on premise customer wait six months when you consider these are likely to be larger deployments.  I don’t understand the 6 month delay at all, it’s confusing to customer, developers, everyone and isn’t going to persuade anyone to move from On Premise to CRM online????

Machine Learning

Machine learning sounds really interesting and using customers data to make recommendations and suggestions would be awesome.

Social CRM

Social CRM is moving from listening to interacting and integrating with the customers CRM data.

Integration

Microsoft are continuing to slowly to properly integrate their companies and products they purchased.  Parature integration is looking to bring in the powerful knowledge base functionality into CRM (whilst also Microsoft are creating their own knowledge base functionality!!!).

I find the slow rate of integration a bit puzzling, Microsoft purchased Parature ages ago.

CRM 2016 Hosk Notes

Here are my thoughts on the CRM 2016 preview guide, this is a developers eye view.

Below are my brief notes on the CRM 2016 preview guide

Productivity

  • CRM App for Outlook
  • Excel templates
  • Delve

Microsoft as a company seem to be focusing on improving productivity of office workers.  This involves integrating Microsoft’s differences products\services and the increased use of machine intelligence.

Intelligence

  • Cortana Analytics suite and machine learning
  • Intelligence product suggestions
  • recommend cases
  • Machine Learning

Personally I’m not interested in Cortana, I don’t want to talk to my computer or CRM but Microsoft keeps working at it, integrating into more applications so I am probably going to need to get used to it.

The machine intelligence is one area I find really interesting.  I view it as CRM using the customers data to help, recommend similar cases or knowledge articles for the case your are working on.  Intelligent product suggestion based on your selected choices.

I imagine it working in a similar way to Amazon using your viewing history and purchasing history to recommend other products.  If Microsoft can add this type of functionality into CRM then it would be fantastic.

I currently have no idea how Azure Machine learning works and my mind boggles at how you would set it up??

Mobility

  • Offline capabilities
  • Task based mobile apps
  • Cortana

The mobile app is slowly getting better but my question to Microsoft is why is it taking so long?  This is almost 3 years of development on the mobile app now.  Progress is being made, offline capabilities for mobile apps are always good and Task based might make it more useful in some circumstances.

Unified Service

  • Field Service (a company/product Microsoft purchased last year)
  • Parature knowledge management (meant to be very good)
  • Native Knowledge management

Integration between the purchased products continues slowly

Marketing

  • SMS Marketing – {shudder}, I don’t think I have ever received a welcome SMS message.
  • Email – view Generated HTML

HTML emails are great, SMS marketing is a bad concept (no one likes receiving text messages, its like a pop up for phones)

Interesting stuff from a CRM developers perspective

  • Bulk Data Loader for CRM online
  • a new cloud service to bulk import/export data in Dynamics CRM online.
  • support for reoccuring data import/export
  • Modern Web API – OData v4

There isn’t a great deal for developers to get excited about but the developer tweaks are not usually mentioned in the preview guide (they look at high level functionality and new features).

The new OData v4 will be awesome

The bulk loader sounds interesting because a lot of projects use Scribe to insert data and this could potentially avoid that cost.  The bulk loader can also doing regularly/reoccurring imports and exports

Excel

  • Excel templates
  • Excel What if analysis

Excel is good because most people are comfortable with it, it’s easy to use and people can open it up and try it.  Most companies have an excel license so it doesn’t cost.

The new templates will work by opening an excel document and merging it with a template, which means it should be quick

Document generation – pre defined templates

  • A merge between an instant document and templates.
  • Document templates are role based
  • Work for Word and Excel.

This sound like a great idea.

External Party Access

An API to allow third parties (customers, partners) to access CRM data.  You model the access inside CRM.

Wow, sharing CRM data for third parties.  The question I have is how would the licensing work for this?  How will this fit in the current 2000 different licences you can currently use.

Mobile

  • Can view IFrames!
  • Disable copy and paste to stop data leakage
  • Enforce Encrpytion
  • offline

Some good features added here

Social CRM

  • Interact with customers
  • Publish tweets and facebook posts

The move from Social listening to social interaction makes the social CRM functionality really start to work.

Social  CRM is or will be a key area in customer support and the ability to respond to social media events in cases will become increasingly important.

I will be interested to see how the preview differs from what is actually implemented.

Quote from the preview guide

In addition to Twitter, Facebook, Blogs (WordPress/Tumblr), Videos (YouTube) and News, you will now be able to search boards/forums and custom sources via RSS. This includes internal non-public sources, like Yammer

Guided User Experience

This will probably be very useful to new users but I can already imagine it’s going to be really annoying to experienced users as CRM keeps popping up with advice and guidance (go away you damn paperclip)

Azure Machine Learning

  • Product Cross Sell recommendations
  • Suggested Knowledge based articles

Further reading

don’t forget CRM 2015 rollup

Just because everyone is talking about CRM 2016, don’t forget there has been a patch for CRM 2015

Get Ready for update CRM 2015 1.1

 


Filed under: CRM 2015, Online

Hosk’s Top CRM Articles of the week – 28th September

$
0
0

I have been de-cluttering my stuff the last week, unsurprisingly I have too much stuff, which makes it difficult to tidy it all the way.

This book is amazing, it has changed me from a messy person to a tidy person who now folds his pants and socks! because as the author says “folding is fun”

The Life-Changing Magic of Tidying: A simple, effective way to banish clutter forever

The two key points which have changed the way I view tidying.  You are not deciding what to throw out but what to keep.  If an object doesn’t give you joy then get rid of it.

“Keep only those things that speak to your heart. Then take the plunge and discard all the rest. By doing this, you can reset your life and embark on a new lifestyle.”
― Marie Kondo, The Life-Changing Magic of Tidying Up: The Japanese Art of Decluttering and Organizing

 

The other key concept is once you have decluttered, everything has it’s place.  All of your items should have a distinct place and you put an item back in it’s designated place.

Buy the book, it’s awesome and if you click the link from this page I will get 5 pence or some huge amount :-).  I will be buying some for Christmas presents

Quote of the week

Knowledge alone is static. Know-how is knowledge in motion – Gold rule of software engineering

Joshua Levy

Article the week

Understanding the Microsoft Dynamics CRM Performance Center

Microsoft have added an awesome tool to show you the performance of your CRM forms but then it seems to get hardly mentioned.

The Cobalt blog is the best explanation of how it works I have read.

The most important bit which I keep forgetting, how to get the form up

Hit Control+Shift+Q to open the Performance Center window

Dynamics CRM performance troubleshooting

Good blog with lots of tips on finding performance issues

 Best of the Rest

CRM Web API Preview – Generate Strongly Typed Objects from Metadata Document

Great blog post on using the new Web API preview to create strongly typed objects and I personally loved strongly typed objects

What happens when you publish a duplication rule

have you ever wondered, me neither but someone has.

Online proctored Microsoft certification exams are now available

You can do your CRM exams in your pants in the comfort of your own home, beware they will use your laptop webcam to check your are not cheating.

CRM 2015 – Advanced find to return all enabled users with a security role

A Hosk blog talking about advanced finds

A list of CRM blogs you should be following

A small list of great CRM blogs you should be following

What’s new in CRM 2016 and why you should read the preview guide

Hosk’s looks at the CRM 2016 preview

Getting Cortana to Work on Australian Windows Phones

It’s good to see people putting Cortana to work

Microsoft Dynamics CRM 2013 White Papers & Technical Documentation

A great list of all the CRM 2013 white papers

CRM 2011 – How to set up a lookup using Javascript

How to set a lookup using JavaScript

Storing the “Last Activity” on a Microsoft Dynamics CRM record

Good blog to show you how to store the last activity, who needs machine learning

CRM 2011 shortcuts

CRM has lots of shortcuts, who knew

CRM Plugins – Stopping infinite loops and understanding PluginExecutionContext.Depth

How to stop infinite loops in your plugins, it’s all about the depth

How to get the server time in Dynamics CRM?

You never know when you need to get the server time, it’s like hammer time but better

Great list of CRM version numbers, Release Dates, Build Numbers, and Collateral 

It’s hard to remember build numbers, so luckily someone has collated them all in one list for you

how to Manage Microsoft Dynamics CRM Online updates

A great article from Microsoft about managing updates, you can turn them off to have one a year.

CRM 2015 – Why filtered views are useful

Filtered views are more awesome than you know

New Forms Authentication in ADFS 3.0 and IFD for Dynamics CRM

ADFS 3!

Lookup Field vs Option Sets in Dynamics CRM

Which is better, when should you use a lookup field?

MobileCRM: A different mindset in projects

great article on how to approach mobile CRM projects

Entity Image updater tool

It’s a tool to update entity image

Programming

he Golden Rule of Software Engineering

code reviews

other

Sleep May Be One of Our Most Powerful ‘Antibiotics’

Tires, coffee and people

Tim Ferris Morning Rituals podcast

How Do Excellent Performers Differ from the Average?

a dozen things I’ve learned from charlie munger about mistakes

tips on Writing Funny by Scott Adams

Keeping Things Simple and Tuning out Folly

Solitude and Leadership

What Two Teenagers Learned From Watching Every Best Picture Oscar Winner

Previous top picks

Hosk’s Top CRM Articles of the week – 21st September

Useful Hosk Links

Hosk list Of CRM 2013 Tools

A list and review of CRM 2013 tools, this will probably work in CRM 2015 as well

Hosk’s CRM Developer Articles

A collection of my favourite CRM Developer articles I have written

MB2-703 – CRM 2013 Customization and Configuration Certification Information

All the CRM 2013 content to help you pass the exam

HoskWisdom – Hosk Developer Quotes

 Words of Wisdom from the Hosk.  I have written over 900 articles, surely I should have said a few memorable things


Filed under: CRM 2011, CRM 2013, CRM 2015, Hosk’s Top CRM articles of the week
Viewing all 469 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>