Quantcast
Channel: Magnetism Solutions Dynamics CRM Blog : microsoft dynamics
Viewing all 651 articles
Browse latest View live

How to Solve Lookup Filtering Issue with Dynamics 365 version 8.2.2.128

$
0
0

The October 2017 Dynamics 365 Service Update 1 for 8.2.2 delivers a load of updates and hotfixes for Dynamics 365 Online Instances. Recently, one of our clients noticed that with this update, some of their Lookup filtering on related records was no filtering correctly. Upon investigation, this issue seems to only occur with fields that are being filtered by a lookup, which is located in the header of the form. If you are unsure of whether this will affect your system you can check your version number by clicking on the cog icon in the top right and then clicking on ‘About’.

image

As mentioned earlier, the issue occurs when a lookup field is being filtered by another lookup field located in the header. The screenshot below shows the customization, where the lookup values of the Contact field should be filtered by the lookup value of the Account field when an Account is selected on an opportunity. Unfortunately, this filtering does not occur and the User is presented with a full list of Contacts in Dynamics 365.

image

image

A simple way to fix this would be to also put the field of the related record on the main form as a hidden field. The screenshot below shows that I have added the lookup field located in the header on the form as well and have set it to be hidden. This will allow you to keep the lookup in the header while also maintaining the filtering.

image


Client Access Licence - Troubleshooting User Accessing CRM 2016 Not Showing Entities in the Sitemap

$
0
0

I’ve recently dealt with a user having difficulties trying to regain access into Microsoft Dynamics CRM 2016. The user reported an issue where there are no entities showing in the sitemap. The landing page is also showing error prompts stating that the users does not have sufficient permissions to view the appropriate dashboards and activity feed. This seemed surprisingly odd given that I’ve already given the user the System Administrator role.

image

The following screenshots shows the user accessing the sitemap for Sales and Service, with the out-of-the-box and custom entities missing in the sitemap.

image

image

After further investigation and checking user settings, I noticed that the field Access Mode under the section “Client Access Licence (CAL) Information” in the Administration tab is set to Administrative.

image

Setting this to Read-Write resolved the issue for the user, allowing the user to access Dynamics CRM as usual, with out-of-the-box and custom entities available through the sitemap.

image

Client Access Licence (CAL) is a commercial software licence that allows clients to connect to Microsoft Dynamics CRM with underlying right to access components, services, and other parts of Dynamics CRM. This additional layer of security gives users additional accessibility settings to Microsoft Dynamics CRM.

image

Having CAL = Administrative doesn’t particularly sound useful given our case, as the user is not able to access anything in the system. Further exploring on CAL is when setting CAL = Read, users can access components in the Site Map and view records as per usual, but cannot edit any record information in Dynamics CRM. All records are currently set to read-only, and the user has only limited actions to do e.g. Email A Link, Run Report on the entity record. I could see this being used for users trying to administer and monitor data in Dynamics CRM but not use the actual system itself and have highly limited functionality of only reading data. This is speculating from my findings and implying as to how Microsoft would intend CAL to work in Dynamics CRM.

image

Introduction to Using Feedback in Dynamics 365

$
0
0

Why use Feedback?

The feedback entity gives the user the ability to store feedback that is provided by contacts/people on a specified entity record.

When Would This be Useful?

The best way to show how Feedback is useful is to use an example. Let’s say we’ve created an Event Management system with a few Entities – Events, Venues and Attendees. We decided to host a team building event. After the event has been completed the hosts would like to get feedback from the attendees and log this within CRM. This data can be displayed within a sub-grid on the Event entity from the Attendees.

How to Use the Feedback Entity:

Note:Once enabled, the feedback cannot be disabled on an entity.

First navigate to the entity you’d like to enable for feedback, in this case I navigated to the entity Events within the Default Solution.

image

After enabling this feature, navigate to the chosen entity and click the related entity tab. The Feedback entity will now be shown.

image

Click into the Feedback entity and press ‘Add New Feedback’ you will be prompted with the below page. Some key fields are highlighted and briefly explained in the below image.

image

The regarding field is automatically populated when created from the related entity tab. This is just the record the feedback is given for. It is also worth noting the Normalized Rating in the header of the form, this takes the Maximum and Minimum rating and normalizes the rating provided (Rating – Minimum Rating) / (Maximum Rating – Minimum Rating).

The next step would be to add the Feedback sub-grid to the entity’s form that you have enabled Feedback for. Head to the form customization area and add a new section to an existing or a new tab. Select the section and press ‘Sub-Grid’ in the form ribbon. Verify the options are as follows in the upcoming image.

image

Press Save and make sure to Publish or else you will not see this change.

Navigate back to the entity form and see the Feedback sub-grid with relevant information. You are now able to add Feedback directly from the form.

image

The feedback entity will be useful for organizations who want to provide feedback on specific entities and entity records, it allows them to collect feedback from contacts and display the data in a neat fashion. I hope this blog gives you a good insight into what the Feedback is used for and how useful it truly is.

Setting up Server-Based SharePoint Integration for Dynamics 365 Online

$
0
0

SharePoint is a great place to store files pertaining to records in Dynamics 365, as the storage costs in SharePoint online are much cheaper than the costs for additional storage in Dynamics 365. The Out Of The Box SharePoint integration for Dynamics 365 is also a breeze to set up, and so is an option that should definitely be considered if there is any additional data that you need to store to accompany your Dynamics 365 records. There are a few steps involved, so I will outline them below here.

For this particular example, we will be enabling server based integration with SharePoint online in the same tenant.

If you are considering switching from using the List component to using Server Based SharePoint integration, a list of considerations can be found here: https://technet.microsoft.com/en-us/library/dn792527.aspx

Enable Server-Based SharePoint integration

1.    Navigate to the document management section of the setting menu.

image

2.    Click Enable Server-Based SharePoint Integration. From here it’s just a wizard based process, pretty simple!

image

3.    Select SharePoint location, in this instance, online.

image

4.    Enter the URL of the SharePoint site you want to use.

image

5.    Wait for validation. This may take a few minutes.

image

6.    That’s it for this step!

image

7.    That should land you back in the document management area. Once there, click on Document Management Settings, and select the entities that you want to enable for document management (use with SharePoint).

image

8.    Here you can specify your folder structure. It is possible to have your folder structure in the context of either accounts or contacts, or just stand alone. If you choose the Based on entity option, all records related to an account will be created beneath that account. Similar to account/account name/opportunity/opportunity name. If you decide to go with a flat structure, all records will be created under their entity names in the chosen site. So if you are a sales based organisation, you may want to consider the Based on entity approach to group relevant documents.

image

9.    Once selected, hit next and CRM will create the base level folders for the chosen entities.

image

10.    Success! SharePoint integration is all set up and good to go.

CRM and CX Strategies

$
0
0
image

Is Customer Experience (CX) going to replace CRM? Do I need a new system for CX? What does CX mean for my CRM system? To answer these questions, we need to review the fundamentals of CRM and CX and look at the software functionality required for each.

What is CRM?

CRM is the business strategy to acquire, grow and retain profitable customer relationships and thus create sustainable competitive advantage.
CRM software systems, which enable CRM strategy, are widely available.  Traditionally, they have included the following elements:

•    Powerful and flexible contact management to record customer information and track communications.
•    Sales, Marketing and Customer Service functionality to record and manage these key customer-facing processes.
•    Process automation.
•    Reporting on key metrics.
•    Integration with other systems such as websites, document management systems and accounting or ERP systems.

A CRM system should:

•    Provide a complete picture of your customers and their interactions with your organisation.
•    Empower customer-facing staff and improve their productivity.
•    Help your organisation understand your customers and thus market effectively.

CX Strategy

Customer Experience (CX) is the sum of how customers perceive interactions with your organisation.
Every interaction, across all channels, add up to make your customers feel a certain way about you, based on their overall satisfaction. 
Your organisation interacts with current and prospective customers in many ways: your website, your blog, your social media, your marketing and lead capture, your sales team, your call centre, the events you run. These interactions all contribute to your CX.
How customers feel, their overall satisfaction, will depend on a multitude of factors, most of which are within the influence of your organisation:

•    their ease and enjoyment
•    the value to them
•    their perception of your representative re competence, friendliness and respectfulness

A Customer Experience (CX) strategy might be defined as building and responding to customer interactions in a way that maximises the satisfaction of the customer.
The expectation is that higher customer satisfaction will increase demand in the short term and loyalty in the long run. It leads to long lasting customer relationships and thus competitive advantage and higher revenue. The Forrester study, The Customer Experience Quality Framework, found that the quality of the customer experience impacts loyalty (81%), advocacy (81%) and increased spending (73%).
From a strategic management point of view, CX falls within the CRM strategy.  CRM strategy is an approach or a means to acquire, grow and retain profitable customer relationships.  CX brings an even sharper focus on the customer and the potential to further drive competitive advantage.

Software for CX

Software to enable CX strategy should include the following elements:

•    Mobility - because customer interactions may not be in the office
•    Web-site and mobile Apps to deal with digital interactions
•    Social media integration
•    Event management
•    Contact management to record customer information and track all interactions
•    Sales, Marketing and Customer Service functionality to record and manage interactions related to these key customer-facing processes
•    Process automation
•    Reporting and dashboards

This list is traditional CRM plus some elements not covered by traditional CRM. Some of these additional elements are now covered by CRM and some can be achieved by integration with other systems.
Up-to-date CRM systems now include:

•    Mobility including an out-of-the-box mobile App
•    Out-of-the-box integration with Social Media channels

Furthermore, CRM systems are routinely integrated with the following systems:

•    Event management systems (event management can also be developed within CRM.)
•    Web sites and web-portals
•    Custom mobile Apps

Extend your CRM with CX

A CX strategy can extend your CRM strategy by delivering the right data at the right place and completing the last mile of the customer interaction. It can become a holistic customer-centric strategy which delivers relevant, personal and superior customer service to achieve increased competitive advantage.
A CRM system needs to constantly evolve and adapt to changes – both internal and in the wider marketplace. CRM was never meant to be installed and put on autopilot. Furthermore, a CRM system should not operate as a separate software application. It needs to be integrated with other key systems to unlock value.
Your CRM system can be readily extended to include functionality needed to implement your CX strategy. Assuming your CRM system is current, what is needed is integration with your digital front-end including websites and custom mobile Apps.

If you haven’t already, enhance your CRM strategy with CX. Then work with your CRM delivery partner to enhance and integrate your CRM system to enable CX in your organisation.

Bookmarklet to Open New View Editor from a Solution in Dynamics 365 v9

$
0
0

One of the most welcome new features in Dynamics 365 Version 9 is the new view editor, which has improvements over the old view editor such as being able to add and reorder fields via drag and drop. However, it is only available inside the App Editor, which means if you try and edit a view within a solution like normal it will open the old view editor.

To get around this I have created a bookmarklet that can open the new view editor from within a solution.
To use it copy the following code into a browser bookmark, then when you have selected a view from within a solution launching the bookmark will open the editor for the selected view.

image

javascript:var frame = $("iframe").filter(function () { return ($(this).css('visibility') == 'visible') }); var form = frame[0].contentWindow; var sel = form.document.getElementsByClassName("ms-crm-List-SelectedRow"); if (sel.length > 0) {var url = ("/designer/view/FD140AAF-4DF4-11DD-BD17-0019B9312238/" + APP_SOLUTION_ID + "#/ViewDesignerCanvas/" + form.getViewId(sel[0].getAttribute("oid"))).replace(/{/g, "").replace(/}/g, ""); form.openStdWin(url, "_blank", 1280, 720);}

Using a Console Application in an Azure Web Job to Perform Scheduled Tasks

$
0
0

Recently I was tasked with developing a scheduled service which would be hosted in Azure. This service needed to retrieve data from a database and update the corresponding records in a Dynamics 365 instance. For this I decided to go with an Azure Web Job, over other options like Cloud Services and Azure Functions, mainly due to their simplicity in development and that they are very easy to deploy.

image

Azure Web Jobs can be two different types, continuous and triggered. Continuous web jobs are started as soon as the job has been created and are run in an endless loop. Triggered web jobs are only run when they are triggered manually or are running on a schedule. For this example, we will be using triggered jobs as we would set the job up to run on a schedule. The screenshot above shows a simple console application which would be used for the web job. When scheduled, this console application would run the Main method which would then run the logic you choose implement in the DoScheduledJobs method. For logging we can use Console.WriteLine which will print your logs in the Azure Portal for each of the jobs run. The screenshot below shows how the logs in portal would look.

image

image

The screenshot above shows the Azure Portal for a few existing web jobs I have previously created. Clicking the “Add” button brings the flyout on the right side of the screenshot and allows us to add a new web job. You would need to give the job a unique name, a zip file which contains the console application and a type of job. In this case I had selected the “Triggered” type with a “Scheduled” trigger and had set the schedule to be “0 5 * * * *”. This schedule uses a CRON expression with this example CRON expression scheduling the job to be run hourly on the 5th minute of the hour, for example 12:05, 1:05, 2:05, etc. Once you hit OK and select “Run” the schedule will begin and the console application will be triggered every hour. By clicking on “Logs” you will be able to see the jobs that were run and the logging you had added in the console application in real time.

Dynamics 365 V9 JavaScript Web Resource Dependencies

$
0
0

Prior to the V9 update to Microsoft Dynamics 365, if a JavaScript Web Resource was dependent on another, both had to be added to the forms scripts or on a ribbon button command in the correct order.  Forgetting to add a required JavaScript library to the form was one of the most common errors for JavaScript in CRM, not to mention the issues caused from the parallel loading of scripts on the form from UR12 onwards.

However, in V9 you can now specify what JavaScript resources are required from the Dependencies tab on the Web Resource.

image

In this example I have added the Alert.js library as a dependency. This means that Alert.js will be automatically loaded when this Web Resource is added to the form scripts. It will also be loaded for Ribbon commands and enable rules, removing the need to create dummy IsNaN functions.

In addition, this will act like other dependencies in CRM, not allowing Web Resources to be deleted if they are required by other Web Resources, and showing as a missing component if missing from a solution.

image


Dynamics 365 V9 - SharePoint Integration Now Displays Folders Again

$
0
0

With the release of the Server-side Sync SharePoint integration with Microsoft Dynamics CRM 2013, one of the features that did not carry over from the list component was displaying of SharePoint folders. If a document folder contained say 4 folders each with its own documents, in the Documents area in Dynamics 365 only the documents would be displayed in a flat format as if the folder hierarchy did not exist.

The only way you could tell that a file was inside of a folder was from the path column, in addition you could not create folders from Dynamics 365, and if you uploaded a file you could not place it inside an existing folder.
This really hurt the usage of the SharePoint integration when users needed folders, only really using it as a shortcut to open the SharePoint location.

However, in the V9 update folder support has now been added.

image

Folders are now displayed in a similar way as the old List Component did, the files are displayed using the folder hierarchy that matches SharePoint, files can be uploaded into specific folders and folders can be created. There are even new breadcrumbs to allow navigation back to parent folders.

image

However, if the previous functionality is desired, changing the view to “All SharePoint Document” will return to the flat file view as in previous versions.

image

Dynamics 365 Online Authenticate with User Credentials

$
0
0

Integrating with Dynamics 365 Online is straightforward since it exposes Web API endpoints. But the hardest bit is authenticating since Dynamics 365 Online uses OAuth2.0 as an authentication method, a valid access bearer token issued by Microsoft Azure Active Directory is needed and used in every HTTP requests to the Web API.

imageThere are a couple of ways to authenticate and obtain a bearer token which will be covered in future blogs but in this blog, I will cover using user credentials (Active CRM user’s username and password). Also covered is how to obtain a bearer token from a refresh token when token is expired. Here are the steps you would need to follow to authenticate using User Credentials.

1.    Get Bearer Access Token by sending HTTP POST request to Token endpoint

The Token URL endpoint for any Dynamics 365 Online instances would be https://login.microsoftonline.com/common/oauth2/token

The body content of the HTTP Request will contain the following and will be URL encoded.


KeyValueDescription
client_id2ad88395-b77d-4561-9441-d0e40824f9bcDefault Client Id which is setup against Dynamics 365 Online instances.
resourcehttps://authenticatedemo.crm6.dynamics.com/Dynamics 365 Online Instance URL
usernamejohn@authenticatedemo.onmicrosoft.comActive CRM Users username
passwordPassw0123Active CRM Users password
grant_typepassword

Password set as a grant type


HTTP POST Request:

POST https://login.microsoftonline.com/common/oauth2/token

Accept: application/json

Content-Type: application/x-www-form-urlencoded


client_id=2ad88395-b77d-4561-9441-d0e40824f9bc&

username=john%40authenticatedemo.onmicrosoft.com&

password=Passw0123&

grant_type=password


HTTP Response:

HTTP/1.1 200 OK

Content-Type: application/json; charset=utf-8

{
     "token_type": "Bearer",
     "scope": "user_impersonation",
     "expires_in": "3599",
     "ext_expires_in": "0",
     "expires_on": "1513203043",
     "not_before": "1513199143",
     "resource": "https://authenticatedemo.crm6.dynamics.com/",
     "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6In……………… ",
     "refresh_token": "AQABAAAAAABHh4kmS_aKT5XrjzxRAtHzAKfFmI……………….. "
}


2.    Set the Authorization Header of the HTTP GET request

From HTTP Response in step 1, extract the string value of the access token key which will be the bearer token.

{
     "token_type": "Bearer",
……………………………………………
   "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6In……………… ",
     "refresh_token": "AQABAAAAAABHh4kmS_aKT5XrjzxRAtHzAKfFmI………………. "
}

Set the Authorization header value of the HTTP OData request to be Bearer <access token>

HTTP GET Request:

GET https://authenticatedemo.api.crm6.dynamics.com/api/data/v9.0/accounts?$select=name
Accept: application/json
OData-MaxVersion: 4.0
OData-Version: 4.0
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6In………………………


HTTP Response:

HTTP/1.1 200 OK
Content-Type: application/json; odata.metadata=minimal
OData-Version: 4.0


{

"@odata.context":"http://authenticatedemo.api.crm6.dynamics.com/api/data/v9.0/$metadata#accounts(name)",

"value":[

{

"@odata.etag":"W/\"1257828567\"","name":"Test A","accountid":"e0b6ae92-4230-e711-80bf-00155d048d78"

}

]

}


3.    Refresh Expired Bearer Access Token

Use the refresh token to obtain a new access token once previous token has expired.
The body content of the HTTP Request will contain the following and will be URL encoded

KeyValueDescription
client_id 2ad88395-b77d-4561-9441-d0e40824f9bcDefault Client Id which is setup against on Dynamics 365 Online instances
resource https://authenticatedemo.crm6.dynamics.com/ Dynamics 365 Online Instance URL
refresh_token AQABAAAAAABHh4kmS_aKT5XrjzxRAtHz…. The string value of the refresh token key obtained in step 1.
grant_type refresh_tokenrefresh_token set as a grant type


HTTP POST Request:

POST https://login.microsoftonline.com/common/oauth2/token
Accept: application/json
Content-Type: application/x-www-form-urlencoded

client_id=2ad88395-b77d-4561-9441-d0e40824f9bc&
resource=https%3A%2F%2Fauthenticatedemo.crm6.dynamics.com%2F&
refresh_token=AQABAAAAAABHh4kmS_aKT5XrjzxRAtHzAKfFmI…………………………………&
&grant_type=refresh_token


HTTP Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
     "token_type": "Bearer",
     "scope": "user_impersonation",
     "expires_in": "3599",
     "ext_expires_in": "0",
     "expires_on": "1513203043",
     "not_before": "1513199143",
     "resource": "https://authenticatedemo.crm6.dynamics.com/",
     "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6In……………………………",
     "refresh_token": "AQABAAAAAABHh4kmS_aKT5XrjzxRAtHzAKfFmI…………………………… "
}

Store the refresh token safely in a database or any other storage system, then you can reuse this refresh token every time to obtain a new access token. So, if the Dynamics 365 user changes their password this method of using the refresh token to authenticate will still work.

How to Change User Session Timeout Settings in Dynamics 365 Online

$
0
0

In Microsoft Dynamics 365 online, timeout for a user’s session is set to 24 hours by default. This means a user is not required to re-enter their login details for up to 24 hours. However, now we can update these settings based on our requirements. In this blog, I will go through the steps to make such changes.

In Dynamics 365 online instance, go to Settings Administration System Settings. Then click on General tab.

Under the section Set session timeout, we need to set “Session timeout settings” to “Set custom”. This will allow us to change the maximum session length and how long before the warning is shown.

I decided to set maximum session length to 300 and I wanted the users to be shown the timeout warning 25 minutes before the session expired. The following screenshot shows what I changed the values to.

image

The value for maximum session length need to be between 60 and 1400, and the value for timeout warning has to be between 20 and 1439. If invalid values are entered an error message is shown like the one in following screenshot.

image

Be sure to click on OK once the changes have been made.

There are a few things that we must keep in mind. The user making these changes needs to be a System Administrator and changes are applied to all the users.

Fixing Incorrect Views Width After CRM 2011 to Dynamics 365 Upgrade

$
0
0

Recently, we upgraded a client’s CRM 2011 to Dynamics 365. For some entities, the associated view of related entities of a record didn’t have the correct width when accessed from the navigation area, resulting in some whitespace to the right of the screen as shown in the yellow highlighted area below.
  image
After some trial and error, I found a solution to this problem. In this blog, I will walk through the steps to overcome this issue.

Solution:
1) Open the form editor. For example, I opened the form editor for Contact form (assuming the record was of type Contact and Activities associated view had incorrect width).
2) Remove the entities from the Navigation that had incorrect views width when being viewed from the form’s navigation area. To do this first click on “Navigation”, and then remove the entity relationship by double clicking on it. For instance, to remove Activities entity from navigation area, I would click on “Activities” on left of the page, and then click on “Remove” button.

image

3) Then save and close the form, and be sure to publish all the changes.
4) Then open the same form again, and add the removed entity back into navigation area. To do this, locate the entity on right of the screen, double click on it. Then relocate the entity on navigation are by dragging it if required.

image

5) Save and close the form changes, and be sure to publish all the changes.

When we go back to the same associated view of the related entity, we can now see that the view takes up the full screen width.

image

Note: This approach also works if you are using Editable Grids instead of normal views.

Calling the Progress Indicator in Microsoft Dynamics 365

$
0
0

One of the great features in the release of Dynamics 365 was out of the box functionality to display the progress indicator on the form. It’s most beneficial in cases where users have to wait for the data to load or for the long-running process to complete. It may also be used to prevent users from doing anything on the screen until the background process is completed, consequently enhancing the customer experience.

It provides a great ease to the developers as this can all be done by a single JavaScript piece of code and thus relieving the developers from the pain of writing custom code to achieve similar functionality. The indicator can just be called with the below JavaScript function of the Xrm.Utility namespace:


Xrm.Utility.showProgressIndicator(“Loading Records. Please wait!”);


This function takes a string parameter to display on the progress indicator. The string takes up to 36 characters. For the characters above this limit, it truncates them by replacing it with three dots at the end of the sentence.

This is how the indicator looks like on the form:

image


Xrm.Utility.closeProgressIndicator();


The above method is called to hide the indicator. It doesn’t take any input argument and won’t do anything if the progress indicator isn’t visible on the form.

Introducing Xrm.Panel for Microsoft Dynamics 365

$
0
0

Panels are a convenient feature introduced as a preview feature in the December 2016 update for Dynamics 365 (see: https://msdn.microsoft.com/en-us/library/mt790281.aspx ). Although technically available, the functionality didn’t appear to do anything until version 9 (tested with v8.2 on-premise).

The feature is still in preview, but does provide access to some helpful capabilities. It is important to note that as the feature is still in preview Microsoft does provide a disclaimer that the feature is not meant for production use, and the current API reference is woefully lacking. You can find the documentation for this here: https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/xrm-panel

What It Does

The panel API provides a method to display a web page in the side pane of the Customer Engagement form. Think of it as an iFrame that is accessible from most locations in the Dynamics 365 system. The main place that we want to be using it however is on entity forms.

image

Figure 1: Displaying the Panel from a Dashboard

Usage

The panel is opened and closed using the Xrm.Panel.loadPanel(url, title) method.

In order to load the panel, simply call the loadPanel function with a url like so:


Xrm.Panel.loadPanel("https://www.bing.com");


This will load the target web page into the panel. To close the panel, simply call the loadPanel function with a blank URL. Note that this is not a null URL, but an empty string.


Xrm.Panel.loadPanel("");


It is also possible to load Web Resources into the panel, which can provide another handy place to display custom functionality.


I have created a simple web resource here which has been loaded into the panel using the web resource URL.


Xrm.Panel.loadPanel(Xrm.Utility.getGlobalContext().getClientUrl() + "/WebResources/new_/html/helloPanel.html");


Results in:

image

Limitations

The target web page must allow being displayed in an iFrame. This means that while http://www.bing.com may be displayed, https://www.google.com may not be.

There is no direct access to the Xrm object from within the Panel frame, so any web resources loaded into the Panel will need to manually navigate to a frame on the page that does have access to the Xrm object in order to use those methods, or add a reference to ClientGlobalContext.js.aspx from inside your web resource.

Solution Form Social Pane Issue After CRM 2011 to Dynamics 365 Upgrade

$
0
0

Recently, we upgraded a client’s CRM 2011 to Dynamics 365. On the forms of many entities, the Social Pane wasn’t working normally. The users were not able to add activities and notes. 

image

After some trial and error, I found a solution this problem. I created a new form for the affected entities and added the Social Pane on those forms again. This solved the problem. While doing this for rest of the entities, I also noticed that when we create a new form and merge that new form with old form, problem no longer persists for that new form.

There is one thing that we need to keep in mind, if we create a new form by using “Save As” option on the old form, the problem will not be solved (at least not in my case). The following screenshot shows what the social pane looked like after I created a new form for the affected entity, and published all the changes.

image


Fixing Plugin Not Triggered on Create of a User in Microsoft Dynamics 365

$
0
0

I recently had to write a plugin for a client that would be triggered when a user was created. This plugin would create some custom settings records for that user.

The first thing I tried was creating these records when a user was created however despite being able to register a plugin on create of a user, nothing I did would trigger the plugin!

The second thing I tried was to trigger the plugin when the user was added to the default team because every user is assigned to the default team automatically when they are created. Again, this did nothing.

My ultimate solution was to register the plugin on associate of a user to a security role. The role I chose was one that all users are assigned when they are created. As all users are assigned the role shortly after they are created, you could argue that this is the same as triggering a plugin on create of a user. It also meant that we could still ensure that the user would have permission to own the records that we were going to create for them.

The following shows some of the steps that I took to resolve this issue.

The plugin needs to be triggered on associate of a user to a security role. The Associate SDK message does not take any entity parameters. This must be handled inside the plugin code.

image

The following code shows how you can check that the target entity that triggered the plugin is a system user, as well as that the related record is a security role.

image

An alternative approach would be to use a workflow which runs on create of a user. You could use the workflow designer if you are doing something simple, or include custom logic for more complex scenarios.

How to Save Files in a Supported Manner Using Dynamics 365

$
0
0

With the move to Dynamics 365 version 9.x, many new methods have been added to the Client API. One of the particularly useful ones is the ability to (in a now supported manner) save files directly from Dynamics 365.

A link to the documentation can be found here: https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/xrm-navigation/openfile

The functionality is fairly simple to use, and requires specifying the following parameters:

  • file
    • fileContent– String - Base 64 encoded string containing the content for the file.
    • filename– String - Name of the file. This does not have to be base 64 encoded.
  • fileSize– Number - Size of the file in KB
    • While the documentation says this parameter is required, the operation will be successful even if this is not included as the filesystem will automatically determine the size of the file.
  • mimeType– String - MIME type of the file
  • openFileOptions
    • Number – 1 = Open file, 2 = Save file
    • At the time of writing this, when testing in both Chrome and IE, the open and save file options appeared to perform exactly the same.

A few instances in which this functionality might come in handy are:

  • Saving files that already exist in Dynamics 365:
    • Attachments (activitymimeattachment) are files that are saved in the database.
  • Saving custom files from Dynamics 365:
    • Data that exists in Dynamics 365 can be obtained via queries and put into an appropriate format for download.
  • Example use cases:
    • Download associated record collections as CSV file
    • Format form data and download
    • Note above are trivial examples, as they can also be accomplished with Mail Merge and Export to Excel functions.
  • Custom data can also be used:
    • A JavaScript trace file could be saved to show a log of errors that occurred while processing, which could be handy as this is normally not available to the user (usually only plugin trace files are available)

The openFile method is available through Xrm.Navigation, which means it is available everywhere the Xrm.Navigation object is, including from the main window: _top: main.aspx

Example Code:

image

Note that the function btoa is also being used: this is a JavaScript function that base 64 encodes a String object.


The above code results in:

image

image

How to Reset to a Different CRM Version in Microsoft Dynamics 365

$
0
0

If you created a new Microsoft Dynamics instance recently, you may have noticed that the version of the instance is v9.x. If you created this for dev purposes, you may need this to be CRM v8.x or perhaps an even earlier version, and thankfully it’s pretty easy to set this up.

Please note that this should only be used when setting up a NEW instance, as resetting the instance will clear all data.

1. Navigate to the instance admin portal (https://port.crm.dynamics.com/G/Instances/InstancePicker.aspx?redirect=False). Note that this is the url for North American instances. In the case of instances in other regions, substitute [crm] for your region, e.g. [crm6] (Australia) etc.


image

2. Select the instance and click edit
3. Make the instance a sandbox, click next then save. It is necessary to make the instance a sandbox at this point, as production instances cannot be reset.

clip_image002

4. Click reset then select target version. You will see the options for which version you can reset to in the screenshot below. Once you have selected the desired version (and any applications you want to install), click reset. You will be given a confirmation prompt. Once you have read this, click yes to continue. The reset process may take some time to complete. THIS WILL DELETE ALL DATA IN THE SYSTEM AND IT WILL NOT BE ABLE TO BE RECOVERED.

image

image


5. (OPTIONAL) make instance a production instance again by clicking edit and changing the instance type (similar to step 3).
And voila! The instance is now a different Dynamics 365/CRM version.

image

Dynamics 365 Online Authenticate with Client Credentials

$
0
0

The previous blog covered details on using User Credentials to authenticate with Dynamics CRM 365 Online. This can be a problem when executing long running background application processes that integrates with Dynamics CRM 365 Online.  The problem is that a User can change their password therefore the configured password against the background application would always need updating.

Using Client Credentials for authentication with Dynamics CRM 365 Online will resolve this issue of using User Credentials which constantly changes and requires a Dynamics CRM 365 Online license. Client Credentials are made up of a client id and client secret which firstly need to be setup and generated in Microsoft Azure. Once you have the client id and client secret, this can be used to obtain a bearer token. Here are the steps you would need to follow to authenticate using Client Credentials.

1. Register a App against Azure Active Directory
i. Log into https://portal.azure.com, navigate to Azure Active Directory -> App registrations and click on New application registration

image

ii. Create the new App registration with Web app / API as the Application Type

image

image

iii. Grant permissions to Dynamics CRM Online by navigating to Settings -> Required permissions. Click on Add and select Dynamics CRM Online

image

iv. Select the following permissions then click Done

image

v. Dynamics CRM Online should now be added to the list of Required permissions. Click on Grant Permissions to complete the process
  image

vi. Setup client secret key by navigating to Settings -> Keys, create a new Key and save to generate a new Secret key value

image

NOTE: Take note of the generated key value since it would not be visible the next time you navigate to the Keys List

2. Create a new Office 365 user
i. Log into https://portal.office.com/adminportal, navigate to User -> Active users and click on Add a user

image

ii. Fill in User details

image

iii. Assign the Dynamics 365 Service Administrator Role

image

iv. Apply the Dynamics 365 Product Licence and click Add

image

3. Create a new Dynamics 365 Application user
i. Log into Dynamics 365 Online, navigate to Settings -> Security -> Users and change the view to Application Users. Click on New to open a new Application User Form

image

ii. Fill in the following fields.
The value of the Application ID field will be the GUID value obtained from previous steps 1.

image

iii. Once saving the record the following fields will be auto populated by Dynamics 365

image

4. Create new Security Role and assign to Application user
i. Navigate to Settings -> Security -> Security Role and Copy the System Administrator Role

image

ii. Name the new security role and completed the creation process

image

iii. Assign the new security role to the Application User

image

iv. Remove Dynamics 365 license for the User in Office365 admin portal

image

5. Get Bearer Access Token by sending HTTP POST request to Token endpoint
The Token URL endpoint for any Dynamics CRM 365 Online would be https://login.microsoftonline.com/<tenant id>/oauth2/token

Obtain the tenant id from the Azure Portal

image

The body content of the HTTP Request will contain the following and will be URL encoded

image

A refresh token is not included as part of the response when using Client Credentials to authenticate, this is only available when authenticating using User Credentials.

So once the access token has been obtained then you can use this token in the Authorization header for all the request to Dynamics CRM 365 Online Web API.

Workaround with Report Authoring Extension Connection Issues with Dynamics 365 V9

$
0
0

Now that Microsoft are enforcing TLS1.2 for Dynamics 365 V9, a bunch of older tools will no longer be able to connect to CRM. This currently also includes the Report Authoring Extension for SQL Server Data Tools that allows creating FetchXml reports, as there has been no new version released for V9 yet.

Currently using the latest version of the Report Authoring Extension, while you can set up your Data Source and Datasets as normal, when you go to preview the report it will ask for credentials, and then get stuck when you go to select which CRM Organisation to connect to.

image

A way to work around this is by using Fiddler, as it can operate as a proxy between the report and Dynamics 365.

To do this in Fiddler go to Tools => Options => HTTPS and add tls1.2 to the list of allowed HTTPS protocols. To edit the HTTPS protocols, you need to click on the list of protocols as highlighted below.

image

After that while the Capture Traffic settings is set to On (File => Capture Traffic), you will be able to Preview the report successfully.

Viewing all 651 articles
Browse latest View live


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