Strange whitespace on form

Problem

Today I faced a strange issue that was driving me crazy. I noticed that some entities on the Online instance (v8.2.2) have strange whitespace on the right side of the screen. I couldn’t even find the DOM element that is sitting there in this whitespace. Quick JS fix could be applied to set the width of the left element(actual form) to 100% on form load and everything will work just fine, but it’s not how I wanted to solve this issue. The issue is shown in the image below.

Image 298

I tried to create a new form, change entity properties, etc, but nothing happened. I even created a new entity that had the same problem. Every single entity that is newly created had this issue.

Solution

The problem can be resolved only by publishing the main form with some configuration changes in the Display tab.

Fields that can be changed are:

  • Show navigation items
  • Show image in the form
  • Max Width

When you any of those fields and publish your form issue will not be there anymore.

When I dived deeper into research I found out that after I exported the solution with the affected entity and compared customization.xml before the fix and after the fix there were some differences in it.

Before the fix, there was just the blank form tag defined in XML:

After the fix, there were some additional parameters defined:

But there is also a navigation node added:

 

Change to WordPress.org

Hi everyone!

Since I had some problems when trying to post code snippets on WordPress.com and for me it’s an important thing that I can post code snippets in my posts I decided to set up WordPress.org version of the blog.

From now on the blog has a new URL and it can be found on the dynamicsninja.blog.

I will keep the old blog up till I change all the links posted around to the new address, but new posts will only be posted on the new blog.

I can’t tell you how happy am I because I can finally format my code snippets the way I always wanted.

Cheers!

Client API – lookupObjects

clientapi-xrmmodel

New Client API

Lately, I’m exploring Client API that came with Dynamics 365 v9.0 and I can tell you that it has a bunch of cool stuff that is not used that frequently by the Dynamics community.

My top 3 namespaces are:

  • Xrm.Navigation (alert and confirm dialogs)
  • Xrm.Panel (side panel that makes some integrations look seamless)
  • Xrm.Utility (a bunch of new things)

In this post, I will show you one use case of a feature that made me so happy, because I always had a struggle when I tried to make look & feel of Dynamics lookup fields in my custom web resources.

This feature is of course Xrm.Utility.lookupObjects

The struggle

Every time I wanted to use lookup input field in my custom web resources I had the same problem. Which kind of control to use to present the lookup input field?

Sometimes I went the autocomplete route, but I had problems with validating the wrong values (user searched something and left the value that was not found in the textbox) or I went the dropdown route which was not that good option because it lacks a search option, but it forces user to choose the right value.

Solution

New API call Xrm.Utility.lookupObjects solved my problem and saved me some (BIG) amount of time. That new function allows you to open lookup browser with entities that you want to search for and returns the object containing record GUID, entity type of the record and a name of the record.

Example

My goal was to create a simple example that will display what you can do with the new function.

The goal is to create a popup window on a contact entity that will allow you to pick some system user in the popup and initiate a task entity creation that will have picked user as the owner of the task and the current contact in the regarding field.

I hope that example is simple enough to show you everything that is relevant while using this function.

Before we start making the solution I wanted to note that I really like Alert.js solution that makes popup windows in Dynamics so much easier. It has some downsides of course, but for the most challenges, it does a great job.

First, we need to make a simple HTML web resource that will be popped up. HTML code is shown in the code box below.

After we have created the HTML file we need to create a JS file that will invoke the actual logic.

There are 2 functions that are interesting here:

  • openLookupDialog
  • populateLookupValue

Function openLookupDialog is called when the user focuses the input element with name ID and it opens the lookup dialog.

There are few parameters that we need to pass to the openLookupDialog function.

Parameters:

  • entityTypes – list of strings containing entity names
  • defaultEntityType – string value of default entity
  • allowMultiSelect – bool value that controls multiple select

This is a minimum set of parameters that you need to pass to make this function work, but there are also other parameters that are mentioned in the official docs page.

The second function is populateLookupValue function that is called as success callback in the previous function. The parameter that is passed into this callback is a list of entities selected in the lookup dialog, but in our case, it returns only a single value because allowMultiSelect is set to false.

Each object inside that list has 3 values: id, name and typename which can be used in data operations after selection.

We use those values (or just a ID part) to create a task after valid record is selected.

Finally when we have the HTML and JS sorted we can add some CSS to get a Dynamics look and feel.

 

After everything is done right we can test our code and see the result. The result is shown in the next 3 steps.

STEP 1

Image 292

STEP 2

Image 293.png

STEP 3

Image 294

Conclusion

I hope that this example will help you when you will face the problem with using lookups in your custom web resources and as you can see it’s not that complex to use the new lookupObjects function in your solutions.

I like this function a lot because it gives the users similar UX as they are used to while using Dynamics.

DeDupe Rules Auto Publisher is available​ for previous​ Dynamics versions

overview.png

Some of the people asked if I can make this solution available for earlier versions of Dynamics. After some struggle when trying to create a v8.1 environment I finally managed to port the solution all the way down Dynamics CRM 2016 or to be more precise to version 8.0.

Download v1.1.0

Now you can install the solution on following versions:

  • Dynamics CRM 2016 (v8.0)
  • Dynamics CRM 2016 Update 1 (v.8.1)
  • Dynamics 365 (v8.2+)

Feel free to report the issues that you have related to this version or just post a suggestion for a new feature.

Error while trying to connect to D365 v9.x via console app

question_mark_png57Lately, I noticed that I started to get errors while trying to connect v9.x organizations via console applications that were using OrganizationServiceProxy. Everything was set up just as it was usually working, but with new SDK it seems that it’s not.

The code below was just not working with all the right parameters sent to the constructor

Image 266.png

Here is the error that was popping out:

'Metadata contains a reference that cannot be resolved: 'https://.crm.dynamics.com/XRMServices/2011/Organization.svc?wsdl&sdkversion=90'.'

After a research and downloading the Microsoft.CrmSdk.CoreAsseblies NuGget package nothing useful was found, but since new versions of D365 Online have a support for .NET v4.6 framework I have updated my project to that version of the framework.

Since then error mentioned above was not present anymore while using Visual Studio 2017. I hope that this info will save you some time you will face the issue above.

TLDR: Update your console app project to .NET Framework v4.6!

Some emails are not synced to D365

sync-fail.png

Dynamics 365 and Exchange integration is plug & play with some minor configuration…I just don’t think so.

Lately, I had an issue that emails were not syncing to the Dynamics 365 using Exchange server via server-side synchronization. We spent like a month of intense monitoring and changing every single parameter in hope that emails will finally get synced without any issue.

Here are some of the tips that we used on our journey which finally made our integration work flawlessly.


Update to the latest Dynamics 365 version

The most basic thing to do is to update to the latest release of Dynamics 365, but of course, I know that it’s not always the best option and most people out there are considering it as the last option if everything else fails.

Image 233

Just trust me that more than few times I regret that I didn’t do an update first before I used too many hours of researching the issue.

Microsoft is adding tons of updated/hotfixes with every release that are not mentioned in the release notes. Last few versions had quite some updates related to the server-side sync mentioned in the notes.

The same email address on multiple entities

You should not use one email address on multiple OOB entities. It doesn’t matter if you are using it on 2 same records like contact entities for example or you just use it on 2 different records like on one user entity and one contact entity.

Image 235

You need to ensure that you just have one record on the instance that has a unique email address that is populated in the OOB email field (eg. emailaddress1,emailaddress2,..).

Syncing same email address on 2 instances

You can forget to disable email sync on the development instance when you finally move your email integration to the production instance.

The first step is to remove server profile from the mailbox on the development instance. Go to the mailbox that you want to sync on production, clear the server profile field and hit save button.

Image 240.png

The next step you need to do it test & enable the same mailbox on the production instance, but you need to be sure that you select the Sync items with Exchange from this CRM org only  checkbox on this step.

Image 239

After those steps, you are sure that emails will be synced only to the production instance.

Change mailbox ownership

The most strange tip is to change ownership of the mailbox form the TEAM to the USER.

Image 241

I know that this sounds ridiculous, but it actually helps in some situations. We came to this solution after talking to MS support that after a while suggested doing so and after that everything just started working like a charm.


I just hope that some of this tips will save you some time while investigating the syncing issue like this one.

CRM Google Maps are available​ for previous​ Dynamics versions

gmaps+crm

Since I found out that it’s possible to revert Dynamics 365 to pre-9.0 releases I made a solution that is compatible with older releases of Dynamics 365.

Now you can install the solution on following versions:

  • Dynamics CRM 2016 (v8.0)
  • Dynamics CRM 2016 Update 1 (v.8.1)
  • Dynamics 365 (v8.2+)

You can find the solution on releases page on Github as usual.

Feel free to report the issues that you have related to this version or just post a suggestion for a new feature.

Downgrade v9.0 trial

economy-downgrade-1

I recently discovered that you can downgrade D365 v9.0 to earlier versions like v8.2 or even v8.1. Also, I noticed that others around me didn’t know that it’s possible to do so and few of us had a need to test or develop something on earlier versions of D365.

Here are the basic steps how to accomplish that downgrade.

  1. Create a new trial D365 instance and go to Administration center.
  2. Click on the Edit button on your trial instance.Image 228.png
  3. Change instance type to Sandbox and click on Next.Image 229
  4. Click Save on the next screen.Image 230.png
  5. Next step is to click Reset on your newly created sandbox instance.Image 231.png
  6. Finally, in this step, you can select the earlier D365 version from the dropdown menu.Image 232.png
  7. After a rather long wait, you can turn your instance back to production one like we did in steps 2 and 3 and you are ready to do whatever you want on your fresh pre-9.0 version of D365.

It’s great opportunity to assemble a pre-9.0 solution on a trial instance if you don’t want to mess your other instances. I can’t explain how happy I was when I found out that I can have a pre-9.0 trial instance which can serve me as a playground for creating managed solutions.

I just hope that I’m not the only one that didn’t know about this downgrade thing and that at least someone will be happy with this feature as much as I was when I found it out.

CRM Google Maps – New Release v1.2.0.0

map

New release of CRM Google Maps is ready for download.

Global zoom setting

You can now set global zoom level that will be default zoom level on every map. This setting will work only if you have only one marker on the map. If there are few markers on the map optimal zoom will be calculated.

Screenshot 2018-03-03 20.26.48.png

Zoom parameter

This parameter can be set on each map individually and that value will override the global zoom value that is set in the configuration page. This parameter is also relevant only if there is only one marker set on the map.

Screenshot 2018-03-03 20.28.32

Refresh

The refresh button is added to the map, so from now on you can press it to refresh map with new data that is changed on the form.

Screenshot 2018-03-03 20.30.35

Feel free to post feature suggestions in the comments section below.

Fight your randomly unpublished duplication rules

duplicate-content-image

If you ever used duplicate rules in Dynamics CRM you probably experienced that your rules unpublish randomly. That’s not 100% random because it’s only triggered when you import and publish the unmanaged solution, but it’s not done every time.

The action that triggers this is Publish All Customization that you invoke every time you import unmanaged solution to the CRM.

I made an managed solution to make your life easier by automating the republishing unpublished duplication rules after those rules are unpublished by Publish All Customization action.

You can find solution on the link. Solution is easy to configure and you will be able to use it in just few minutes after initial configuration.

overview

Check it on GitHub

After initial configuration you just need to select which rules you want to be automatically republished.