Meet great Dynamics 365 people in London 21st November 6pm

I am convinced working on enterprise IT projects is for madmen, and I must be one of them #HoskWisdom

My favourite type of person, is a Dynamics 365 person #hoskwisdom

The Hosk is going to the a meetup in London tomorrow to meet like minded Dynamics professionals, so if you are in the Greater London area please come along

You can hear some live HoskWisdom or hear me talk about how the Capgemini Dynamics team deliver enterprise Dynamics 365 projects

The Capgemini Dynamics 365 DevOps

How we are bringing the best practices from software engineering to Dynamics 365 development

or

just talk about Dynamics 365 development and have a few beers.

It’s a chance to meet the Hosk and say, hmm I thought you would be taller or you are more hairy in person.

If you live in London and love Dynamics 365 or writing code, come down the pub for some drinks, food and networking courtesy of hunters recruitment

 

Advertisements

How to improve as Dynamics 365 developer

Everyone wants to improve but few want to put in the work needed to get better #HoskWisdom

Becoming a champion is not an easy process… It is done by focusing on what it takes to get there and not on getting there – Nick Saban

 

Improving as a Dynamics 365 developer takes dedication and persistence.  It takes years to build up your experience and knowledge but you can speed up the process by learning from the mistakes and experience of others.

This blog post my advice to Dynamics 365 developers who want to improve.  The core message of the post was written to a frustrated junior developer who wrote me an email simply saying “I want to stop making mistakes and get better, what is the quickest way to improve.”

A few posts improving and tips to improve, start by reading those

No shortcuts

Becoming a good Dynamics developer is difficult and takes time, which is why there are so few good Dynamics developers.

 No shortcuts to becoming an awesome Dynamics 365 developer 

It involves focus, effort and learning from your mistakes.  The more focus on improving the quicker you will improve.   It takes time for your skills, knowledge and experience to accumulate and learn from your mistakes.

Aim to finish work wiser about Microsoft Dynamics than you when you started.  Each day learn something new, improve your skills and reflect on your experiences

If you want to be a better coder then commit to being better and start being a better coder now #HoskCodeWisdom

There is no shortcut, only time and dedication.  Warren Buffett talks about Charlie Munger and his focus

“Charlie, as a very young lawyer, was probably getting $20 an hour. He thought to himself, “Who’s my most valuable client?” And he decided it was himself. So he decided to sell himself an hour each day. He did it early in the morning, working on these construction projects and real estate deals. Everybody should do this, be the client, and then work for other people, too, and sell yourself an hour a day.”

Enjoy being a Dynamics developer

 “You must understand the following: In order to master a field, you must love the subject and feel a profound connection to it. Your interest must transcend the field itself and border on the religious.” ― Robert GreeneMastery 

 

If you don’t enjoy Dynamics development you will find the work boring and the days long.  If you are not passionate, you won’t care enough and you devote the time needed to improve.

Want to improve

Development is difficult but rewarding when you do it well #HoskCodeWisdom

Improvement comes from within, it‘s a desire to get better.  You need a passion for development, keep motivated, know why you want to improve if you don’t have a good reason you will give up.

It’s a slow process of continuous improvement, end each day learning something new or improving skills.  This is sucking less each day.  Junior Dynamics developers struggle with the limitations of Dynamics 365 functionality, often creating a customisation only to find due to a limitation the solution won’t work.

Why .NET developers struggle with CRM Development

A student mindset uses opportunities to learn and improve,  the more experience and knowledge you build the fewer mistakes you make.

“Most people don’t have the patience to absorb their minds in the fine points and minutiae that are intrinsically part of their work. They are in a hurry to create effects and make a splash; they think in large brush strokes.

Their work inevitably reveals their lack of attention to detail – it doesn’t connect deeply with the public, and it feels flimsy.”
― Robert GreeneMastery

Visualise your day – plan your day

What will you check? What processes will you follow?  When visualizing the perfect day, remind yourself how you should do everything.

Plan your day, make sure you tackle the important tasks and don’t be reactive to change via email or requests.  Developers need to concentrate and focus on one task, avoid switching between many tasks and losing time through switching.

Don’t let email push low priority tasks to the front of the queue,  Email tasks can be the tasks which shout the loudest but the task you do next should be the most important.

Reflect

Learn from your experiences, review your mistakes you and avoid repeating them.  Inspecting how you work and adapting, keep improving.

Learn from your mistakes, identify patterns, catch yourself from being busy but not productive.

The person who doesn’t learn from their mistakes, repeats them.  Don’t waste your experiences, make the most of them.

Start with the SDK

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

Every time you don’t understand something, read the Dynamics 365 SDK, understand it, master it.

Improve code quality

Read Clean Code: A Handbook of Agile Software Craftsmanship.  To write simple code you need to understand design principles are important, they decouple code and avoid making code brittle.

Brittle code with large methods is hard to read and breaks.  When you change one line of code ,it breaks other unrelated parts of the code.  Controlling dependencies and decoupling code allows you to manage the effects of change.

Naming is important, go back over your code and get the names of variables, methods and classes correct.  Like writing a book, developers never give the best names in the first draft, it‘s important to edit, refactor and refine your code.  The first draft gets it working, further drafts are to simplify and improve readability.

Design code

Don’t just write code. Think about it, design it, write it, refactor it, be proud of it #HoskCodeWisdom

Before you start typing, spend time designing your code, find classes and abstractions.  Designed code is easier to read, debug, reuse, unit test, maintain and extend.  All code has an impact, well-designed code minimizes the dependencies

Understand SOLID principles

SOLID principles are the building blocks of good code.  You will produce better quality code, fewer dependencies, and fewer problems later.  SOLID principles help developers recognise good code.

Help yourself

Don’t suffer in silence and sit frozen in front of the code, don’t waste time not making progress.  Don’t look give me the answer, I want to be pointed in the right direction.  Software development has lots of dead ends where to solve a problem you must rule out options and clarify assumptions.

Resolving your own problems is time-consumingbe pragmatic and know when to spend the time learning it yourself and when to get help.

A useful tool is to describe my problems to a toy/cardboard developer,  explaining the problem to the toy and myself I can uncover the solution and I avoid wasting other peoples time.

Why all developers should be friends with a cardboard developer

Understand how Dynamics CRM works

He who knows the most, get’s paid the most #HoskWisdom

Take every opportunity to understand how Dynamics 365 works. A greater knowledge of Dynamics 365 allows consistent choice of the right customisations and enabling quicker trouble shooting.

Dynamics 365 error messages point you in the right direction

Seek out what you are weakest

Improve knowledge and skills, build up your experience.  Don’t hide from these, focus and improve.  Use weaknesses and mistakes as triggers for learning.

Its better to learn functionality before it’s needed on a customer project, where the pressure is on and deadlines are looming.

How to cope when you are out of your Developer comfort zone

Learn from colleagues

Fellow developers are walking, talking troves of knowledge and experience,  learn from their experience.

Colleagues might be useful sources of knowledge but don’t ask them for help without trying to solve problems yourself.  Solving problems yourself gives you the solution and the learning.

The goal is to create customisations delivering the required functionality but it‘s the journey which improves your skills.  Create customisations and get senior developer to ratify your solution.

All developers have tips, tricks and shortcuts which can help you, if you ask and talk to them.

Write unit tests

Know how are you going to test the logic of your code, understand every line of code is doing what it should.

Test your code with unit testsit‘s best practice and encourages you to write decoupled code which is easy to unit test.

A good framework is Unit Testing Microsoft Dynamics CRM using FakeXrmEasy Framework

At Capgemini we structure plugins to separate business logic and repository layer (CRM SDK CRUD) to make testable.

Unit tests are a vital part of emerging code design 

When manually testingDonjust test the happy path

Talk Dynamics 365

Talk Microsoft Dynamics 365 with your colleagues and you will learn something or at worst give information to someone else.

Share knowledge with the team and work together to create a broad knowledge of Dynamics 365 bringing in your differences experiences and thoughts.

Be organised

Don’t waste time looking for files, projects and code.  Be professional, be organised and minimise distractions.

Get Certified

Certifications gives a more rounded and in-depth knowledge of Dynamics 365.  Investigating functionality in Dynamics 365 which they no practical experience of.

Dynamics 365 is the developers main tool, they should know it inside, outside, up and down.

Studying for Dynamics certifications helps to understand the limitations of Dynamics 365 functionality.  Limitations are key factors when deciding the right customization for a requirement.

Average is not good enough

Developer skills are like a snowball, they start off small and quickly pick up speed as your knowledge and skills grow #HoskWisdom

Don’t do average work, do great work.  Customers and other developers can quickly tell if someone is delivering quality work.  Good developers code works well and anticipates the needs of the users, it contains fewer bugs and when bugs are fixed they don’t bounce back.

Developers who work too quickly often don’t fully understand the requirements, don’t clarify them and deliver what they think the users want.  The code contains assumptions and bugs and never seems to be finished

Deliver code you are proud of

Don’t put non-supported customisations

If you write unsupported customisations Microsoft will not support your Dynamics 365 customisations.  A detailed explanation below

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

Know why things are not working

Errors and functionality not working is an opportunity to learn.  Don’t just find the solution on the internet, make sure you take the time to learn what the problem was and how/why it’s fixed.

Microsoft Dynamics CRM not working? check these common causes

The next problem you might get could be different and the better your understanding of Dynamics 365 the quicker you will be able to diagnose the problem.

Read CRM blogs

There are lots of great Dynamics 365 blogs which will help you keep up to date with the latest functionality in Dynamics 365, you can find a great list of them here

https://community.dynamics.com/crm/b

I also recommend follow these hashtags on twitter

  • #MSDYN365
  • #Dynamics365
  • #HoskWisdom and #HoskCodeWisdom 🙂

Finally here are some of my other favourite blog posts I have written

Hosk’s Top Dynamics 365 Articles of the week – 14th – August

Quotes

But man is not made for defeat. A man can be destroyed but not defeated. Ernest Hemingway

Articles of the week

awesome-1

Best of the rest

Programming/Scrum

Other

The Hosk – currently reading

Hosk’s CRM Developer Articles

A collection of my favorite CRM Developer articles I have written

CRM 2016 – Tips on passing the MB2-712 customization and config exam

All the CRM 2016 content to help you pass the exam

picture from here

Dynamics 365 – You cannot stop Dynamics 365 updating but you can be prepared

If there is no struggle, there is no progress. Frederick Douglass

Dynamics 365 will always surprise you #HoskCodeWisdom

Microsoft Dynamics 365 is evolving. Patches, revisions get added without knowledge or consent of users, major changes must be scheduled and customisations tested.  Most patches fix bugs and improves Dynamics 365 but sometimes changing code causes bugs and problems.

Microsoft Dynamics versions

Version numbering for Dynamics 365 is like Dynamics solutions versions

Major.Minor.Build.Revision 

The current release is of Dynamics 365 8.2.1.341

Read more New naming conventions for Microsoft Dynamics CRM updates

Major releases and numbers

Dynamics 365 as a service

Microsoft Dynamics 365 is a service,  developers cannot access any servers (Front end, back end or SQL server).

Microsoft installs, configures and maintains the servers for our Online Dynamics 365 instance, charging you for this work in your monthly licence cost.

Developers have less control and flexibility.  We cannot scale up servers, SQL databases or performance.  We can’t change database or server settings, we don’t have access and need to work with what is there.

The lack of scaling, configure servers and limitations of Dynamics 365 online developers need to to move heavy processing out of Dynamics 365 and into Azure (avoids performance being throttled) and to enable long running processes.

Plugins and custom workflows in Dynamics 365 online run in sandbox mode which has many limitations, one of the fundamental limitations is plugins/custom workflows must finish within 2 minutes (yes even async workflows run in the sandbox) – Understanding Plugin sandbox mode.

This post covers best practices of Dynamics 365 online architecture

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

Upgrades and updates

Microsoft Dynamics 365 delivers a major release every 2 years (the first number, current version 8) and a minor release every is 6 months.  Microsoft Dynamics 365 has added functionality which allows you to delay updates but you must update once a year (you cannot delay) or before a major release.

You need to manage and plan for updates

Manage Microsoft Dynamics 365 (online) updates

There is pressure to keep up with the releases and not waste time testing the new releases because they cannot avoid taking them.

For the Major and minor releases, admins decided when to apply the update and test the update on sandbox instances.

For build and revision releases Microsoft can apply these any time and regularly applies small patches to fix minor bugs.   Microsoft promises not change anything significant in patch updates.

Patch releases are not always minor

At Extreme 2017 heard a story where Microsoft depreciated a security protocol but hadn’t removed it from the code yet.  Developers were told not to use it, Microsoft being busy didn’t get round to removing it until a few months later and then did so in a patch release.

When the release went live Microsoft noticed a massive drop in Dynamics 365 usage in Australia, lots of code using not supported security protocol stopped working.  Microsoft  naughty making major changes in a patch release rolled this back within in a couple of hours.

A CRM 2011 upgrade which after installed, changed their database and their Dynamics CRM didn’t work.   This lead me to writing the post

Should you keep up with Microsoft Dynamics CRM release cycle?

Microsoft moved to parallel JavaScript loading, which broke everyone’s form load script with the infamous CRM 2011 rollup 12.  I wrote about it in the post

CRM 2015 SP1 – Turbo forms use asynchronous JavaScript web resource loading

Scott Durow saved many a CRM developer with his post Asynchronous loading of JavaScript Web Resources after U12/POLARIS

I recommend you follow Scott’s blog and use the awesome Ribbon Workbench.

When patches attack

Microsoft applied a small/patch release and broke our DevOp‘s automatic deployments.

Over a weekend Microsoft updated our  instances from version 8.2.1.289 to version 8.2.1.341 over weekend.  We noticed because a trial instance was  8.2.1.341, our instances were 8.2.1.289.

This caused problems, the extract customisations script stopped working because the new version of Dynamics 365 needs new versions of client assemblies (8.2.0.556 to 8.2.0.749).

It’s obvious when you know the cause but it we came in to automatic deployments not working and a generic error.  It took a few hours of investigation to find the solution.

Better way

A minor release shouldn’t need an update of client assemblies to interact with Dynamics 365.  If Microsoft wants Dynamics 365 to deliver Enterprise projects, they need to improve the communication and effect of updates.  If they alerted about updated assemblies we could have avoided wasting time diagnosing the problems.

When working with Dynamics 365 online and other online services you have to be ready to diagnose problems, deal with upgrades and potential problems.

Change will happen whether you are ready for it or not #HoskWisdom

Dynamics Salary survey 2017

Price is what you pay. Value is what you get. Warren Buffett

Money should never be the key factor in any decision #HoskWisdom

Nigel Frank do a salary survey every year and it’s improved the insights in the report year on year.

The key highlight is the average wages Dynamics roles earn but there are other interesting insights to make Dynamics professionals and employees think.

The survey won’t cost you to download but you need to give contact details (email, phone) and I’m sure you will be rewarded by being contacted by Nigel Frank in the future.

Nigel Frank Salary Survey 2017

I previously wrote about salary survey in 2016

Interesting Insights

Take into account the survey is a global survey and across all the Dynamics products (Dynamics 365, CRM, AX, NAV, etc)

Below are the insights which interest me

85% of candidates we place stay in their current position for over two years.

 

People will move job 20 times their career, so staying in the same job for 2 years for a career for 40 years is broadly right.

After getting 2 years experience in a new role, external employers will pay more for that experience than the company who is employing them.  This is the difference between a company paying a percentage increase (lets say 5%) and a new company offering a larger pay increase (the value of the experience gained).

2 or 3 years will be people looking to make the next step in their career, many people can get stuck in a position and their career stagnate, looking opportunities elsewhere.  e.g. Career + more pay = move.

21.3 % have been in their current role less than a year

 

A fifth of the people responding to a the Nigel Frank survey had only recently moved, maybe they filled in the survey because Nigel Frank helped them find a new role.  It seems a lot.

Career Development – Lack of progression opportunities cited as the main reason for job dissatisfaction, while only 39% of respondents were happy with in-house training.

 

Most companies don’t seem to invest in people, seeing this as a cost instead of an investment.  It reminds me of this quote from Richard Branson

“Train people well enough so they can leave, treat them well enough so they don’t want to.” Richard Branson

 

I find the lack of training surprising and disappointing because in Microsoft Dynamics industry its all about the people.  Most companies in the Dynamics 365 industry don’t have products and mainly deliver projects and consultancy.  It would make sense to invest in training for those people

Salary – 54% of professionals were satisfied with their salary, while 67% felt that gaining the right type of experience is more important than salary.

 

People always want more money but I believe if you get the experience and skills then you will be paid the money you are worth.  Focus on learning, become awesome and you will get the wages you deserve.

 

85% are male

less than 2% are under 24 – Why is there so few graduates in Dynamics?

39 % are older than 41 with 41% between 31 and 40.

 

I understand Dynamics isn’t a sexy industry to attract people from university and graduates but its a low figure. Experienced people are maybe more suited to Dynamics projects which usually involve more customer interaction.  Dynamics can’t be delivered by coders alone, the projects need close interaction with the business and users.

Most common challenges of Implementing Dynamics products

  • Data migration 52%
  • User adoption 38%
  • Lack of appropriate skills 36%
  • Cost of custom integration 33%

Top reasons to move jobs

  • 37% lack of leadership and vision
  • 50% lack of career or promotion prospects

Here are the salaries for the popular roles, there are more in the survey so check it out.

Picture from here

 

Dynamics 365 – Solutions and stage for upgrade

Courage is fear holding on a minute longer. George S. Patton

Don’t try to avoid failure, make sure you recover #HoskWisdom

Stage for upgrade is useful functionality which allows you delete customisations and components from managed solutions, this post talks about solutions, holding solutions, stage for upgrade and bugs

Solutions

Before you can understand holding solutions and stage for upgrade you need to understand solutions. start with these posts

Microsoft Dynamics 365 uses managed solutions to copy customizations from one Dynamics 365 environment to another (e.g. Development –>Test –> SIT –> UAT –> production).  Managed solutions make  customizations non editable in the target Dynamics 365 environment.

key points

  • Solution is they are additive and they can only add customisations.
  • When you delete a solution it removes the data too.

below are some interesting post I have written on solutions, best practices and problems

Holding solutions

To remove unwanted customisations you needed to use a holding solution to temporarily hold customisations whilst you deleted one solution, an updated solution is imported the customisations removed.

This post walks through the process How to – Delete Components from Managed Solution in Dynamics CRM 2016 without using Holding Solution

Microsoft has simplified this process by automating the holding solution process and having a stage for upgrade checkbox (which uses a holding solution in the background), read this post for more details

This post covers stage for upgrade and patching – Solution Patching in Microsoft Dynamics CRM 2016

Microsoft documentation – Create patches to simplify solution updates

Problems

There is a bug in the stage for upgrade functionality/holding solution process which fails to import the solution or fails to apply the solution upgrade.  The error happens during the import of the solution and you can’t import a solution into the environment.  We can consistently recreate this if any of the entities has an SLA enabled.

There have been other problems with stage for upgrade and removing customisations but we can’t work out what the problem is because we can’t see the SQL environment.

You can reset the Dynamics 365 CRM instance, import  solutions and data on a clean Dynamics 365 CRM instance.  The Capgemini Dynamics team store code and CRM customisations in source control, giving the ability to create solutions with the latest customisation and deploy solutions into an environment.  The deployment scripts can import configuration data with different data for sprint and dev environments.

This approach is OK for sandbox environments (DEV, test, etc) but if this happened in production it causes major problems because the environment cannot be reset without loosing all the data.

Resetting Dynamics 365 environments

We have problems resetting sandbox environments it becomes stuck and the only way to resolve the problem is wait for Microsoft to run an SQL script (which they do around midnight) which fixes the environment.  It’s frustrating we have to wait a whole day, particularly when we have had it twice on one day.

If Microsoft wants to promote Dynamics 365 online and enterprise projects (which use multiple Dynamics 365 instances) then it must provide the tools necessary to manage multiple environments and allow enterprise projects to be delivered using Dynamics 365.

picture from here

Dynamics 365 – Problems debugging fields on a form

“ If debugging is the process of removing software bugs, then programming must be the process of putting them in. ” – Edsger Dijkstra

Dynamics 365 is a place where only dirty entities and fields are saved! The clean fields are ignored #HoskCodeWisdom

  • Junior developer – assumes how things work
  • Good developer – finds out through trial and error
  • Great developer – does not assume and methodically confirms

Dynamics 365 can frustrate developers (The Frustrations of a CRM Developer), developers are provoked by the idiosyncratics, limitations and bonkersness of Dynamics 365 as Microsoft works on new ways to annoy developers 🙂

Bugs and problems areopportunities to gain a deeper knowledge of the workings of Dynamics 365.

New developers get caught out such as in the CRM 2011 (good old) when SetSubmitMode was a rite of passage for Dynamics CRM developers – CRM 2011/2013 – What does setSubmitMode do? and how does it work?

Unless you made the field dirty and change SubmitMode the field was not sent to the database to be saved

Try, Try and try again

On creation of an appointment the start and end times should be editable, on a form update those fields should be readonly.

Examples of using the SetDisabled(true) were found in the code, copied and adapted for the start and end times on the appointment entity.

He kept debugging and being puzzled because the start and end times were not changing, but why not?

Insanity: doing the same thing over and over again and expecting different results.  Albert Einstein

Developer Insanity: Testing the same code over and over and expecting intermittent result #HoskCodeWisdom

Hosk developer debugging beliefs

  • Investigate bugs with an empty mind
  • Microsoft 365 is full of quirks which make sharing knowledge between team members important
  • Bugs are not a sign of a bad developer, they are a sign of a developer developing #HoskCodeWisdom
  • Always help your fellow developers, big projects need a strong team.  Never leave a developer stranded
  • Don’t suffer in silence if you are not making progress, get help and get direction #HoskWisdom

SetDisabled = true

The way to make a read-only field editable is to use the Dynamics 365 JavaScript Xrm, get the control and use the setDisabled(false)

Xrm.Page.ui.controls.get(“your field name”).setDisabled (true); //Field readonly you can’t write any thing on field

if you change true as false;

Xrm.Page.ui.controls.get(“your field name”).setDisabled (false); //Anyone can put value on this field

I looked at the code, it looked fine, we checked a few things

  • Is there any other code changing the field back to read only –> No
  • Checked the line worked in the debugging console –> Yes
  • Was there a JavaScript error –> No
  • Debug the code, does it run the line of code which enables the field –> Yes

Appointment entity

In this example we used the appointment entity, which is an odd entity.  It‘s not possible to add new forms for the appointment entity Dynamics 365 – You can’t add new forms to the appointment entity There is code running on the appointment entity which a CRM developer has no control over, cannot see and cannot edit.

When you book appointment it sets the user who booked the appointment as the organizer of the appointment.  This is fine for Outlook but not what I wanted to happen in Dynamics 365.

Adding hidden custom code which developers can’t disable is frustrating as much as it is undocumented, believe Microsoft should write customizations in the same way standard Dynamics 365 developers do. This would allow us to see, modify, disable or extend the default behavior.

Stop, think

When you rule out the obvious, it’s time to check the stupid – #HoskWisdom

Appointment entities don’t allow you to add new forms (or change the status/status reason of the appointment) because we couldn’t add new forms, we had JavaScript which when the regarding field was set to a specific custom entity we disabled the default section and showed a new section with custom fields on.

Usually a developer would create another form but we couldn’t because it was the appointment entity

This resulted in the same fields being on the form twice, the start and end times.  So the code was working, except it was making the fields on the hidden section and the first fields on the form.

To resolve the problem go to the section (in code) and then retrieve the field you want and then make it make it editable.

Hosk values with bug fixing

  • Developers who fix a problem which doesn’t keep popping back because it‘s not properly fixed
  • Developers who use a bug as an opportunity to learn how Dynamics 365 works
  • Developers should try to resolve the problem first before asking for help
  • Don’t spend too long being puzzled by a bug before asking for help, Dynamics 365 has odd quirks and limitations which can take hours to resolve.  Get direction from a colleague after 1 hour of frustration
  • Developers should not assume, they must clarify (I wasted hours looking in the wrong place because I didn’t check my assumptions)

On a separate note but relatedish – Developers using JavaScript onload should be careful when setting and changing values because it can frustrate user by asking them to save a form when they haven’t change any values When to automatically change fields using Javascript 

picture from here