Showing posts with label Dynamics 365. Show all posts
Showing posts with label Dynamics 365. Show all posts

Saturday, 13 January 2018

Microsoft Dynamics 365 v9.0 latest feature – Show Progress Indicator

Microsoft Dynamics 365 v9.0 latest feature – Show Progress Indicator

In latest release of Dynamics 365 i.e. v9.0 MS has introduces many new features to enhance the user experience, Progress indicator is one of them.

Many times we need to write client side javascript code which take some time to execute due to many reasons (further server side code running etc). In such case, in earlier version user were not able to know that if anything is happening in background and  user needed to wait for next response from crm system.

Now in this release, MS has introduced progress indicator which is can be called as showProgressIndicator function of Xrm.Utility. namespace.
It's take a text string as parameter to display on the progress indicator.
We have created an example test case of it's use in which can be utilize in more relevant cases like while calling any function from ribbon button etc to show message to user.
Here we are loading the mobile no of primary contact of an account and showing it in an alert message and during the period we want user to be informed that system is loading it:

 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function getPrimaryContactMobile()
{
 Xrm.Utility.showProgressIndicator("Loading mobile no of primary contact..");
 setTimeout(delayedLoadPrimaryContactDetails, 3000);
}

function delayedLoadPrimaryContactDetails()
{
 var contact = Xrm.Page.getAttribute("primarycontactid").getValue();
 if(contact == null){
 Xrm.Utility.closeProgressIndicator();
 return;
 }
 Xrm.WebApi.retrieveRecord("contact", contact[0].id, "$select=mobilephone")
 .then(function(result) {
 var mobileno = result["mobilephone"];
 Xrm.Utility.closeProgressIndicator(); //To close the progress indicator
 alert("Mobile no of primary conatct  : " + mobileno);
 })
 .fail(function(error) {
 Xrm.Utility.closeProgressIndicator();
 var message = error.message;
 alert("Error: "+message);
 });
}
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
The result is something like this:


I'm sure it can be useful in more complex scenarios.
Hope it would be helpful.
Happy CRM..!!

Monday, 8 January 2018

Unable to connect Plugin registration tool to Latest Dynamics 365 Version 9.0

Unable to connect plugin registration tool 

Recently i created a trial D365 org (version 9.0.0.3172) and tried connecting plugin registration tool downloaded with PRT of lastes sdk (version 8.2.1.1)from downloaded form here which is latest as on date on that portal of MS.

Newly created trail org is of version 9.0. while the latest sdk available is 8.2 but i though it shouldn't be any problem (though it was) since we were used to of using older version plugin registration tools with newer version of CRM ( remember connecting CRM 2013 organisation with PRT of 2011 sdk).


On some digging i found that reason of the same:

Latest Update on Dynamics CRM V9:


Latest update in the Microsoft TSL(Transport Security Layer) Protocol in SDK assemblies.

Microsoft allowed the TSL connection 1.0  and 1.1 for the browsers or client to connect the CRM org. Now Microsoft will support only TSL 1.2 or above. Can get more information here

If you are connecting your latest dynamic CRM trial org with the old version of plugin registration tool or connecting any external application, then you may face an issue.


TSL protocol of our .Net client is usually 1.0. You can check how to check tsl protocol of your .Net client by downloading fiddler from here

Once Fiddler gets installed, Go to Tools > Options in order to check Protocol version:



To Resolve Plugin registration connection issue we need to install Latest Plugin registration tool from Nuget rather than using PRT(Plugin registration tool) available in latest sdk available on MS website which is version 8.2.1.1 :-

Resolution:

There are 2 way of installing Latest Plugin registration tool easily:-
Option A:-

1. Create/Open a project in Visual studio



2.  Navigate to Tools>NuGet Package Manager>Package manager console


3. Paste following command in Packager manager console and hit enter:
Install-Package Microsoft.CrmSdk.XrmTooling.PluginRegistrationTool -Version 9.0.0.7


once executes, this will install the package in current opened solution folder.

4. Open the folder of the solution opened in Visual studio:


5. You'll see PRT V 9.0 in package folder:


6. Now try to connect to your version 9.0 CRM trial, it'll get connected. :)


Option B:-


1. Create a new project just like step 1 of Option A.

2. Right click on the project and click manage NuGet Packages:


3. Click on browse and enter 'Microsoft.CrmSdk.XrmTooling.PluginRegistrationTool'  and click install:-


4. It'll install the package in your solution's folder:-


5. You can navigate to the installed package same as step 4 and 5 of option A mentioned above.

6. Now connect your PRT with version 9.0 crm org and enjoy plugin registration.

Happy CRM,