You are currently browsing the tag archive for the ‘Dynamics CRM 2013’ tag.

Configuring Entitlements in Dynamics CRM allows us to define how many cases are available to a customer for a certain duration. This functionality was introduced with Dynamics CRM 2013 SP1 in spring 2014. You must upgrade your Dynamics CRM 2013 Organization to Service Pack 1 to take advantage of this functionality.

When configuring entitlements by channel, there is one trick to be taken into consideration. Let’s say for client ABC we need to define entitlements for regular communication channels, like Web, Phone and Email. We also need to define a separate set of entitlements for social channels like Twitter and Facebook.

You need to actually configure in all Entitlements all Channels in order to be able to filter by channel.

Read the rest of this entry »

Advertisements

Service Pack 1 for Dynamics CRM 2013 has been released. It is available for download at:

http://www.microsoft.com/en-us/download/details.aspx?id=43109

Version: 06.01.0000.0581

Release Date: 5/28/2014

Details and a listing of all issues resolved are available at:

http://support.microsoft.com/default.aspx?kbid=2941390

You can install it through Windows Update or manually.

Enjoy!

Other than using Bing, you can easily integrate other geo-location sources. One of the most enterprise level solution is of course Esri Maps. They have a very good solution for mapping. They can also be pricy, so if you are looking for a solution on the cheap, and are not afraid of doing very little coding, read on.

Google Maps provides a very robust mapping API. You can find more details HERE.

To integrate this into your existing CRM, you will use an iFrame, and a custom HTML web resource. Your HTML will include a div tag with an id of “geolocation”. You can use another id, we’re using “geolocation” in the context of this example. Basically, your div will look like so:

<div id="geolocation" style="width: 800px; height: 500px;"></div>

Define the style width and height as needed to render properly within the iFrame at a standard screen resolution set at the enterprise level.

Pass the context to the iFrame, so you can retrieve the address fields. You will use these to build the address string you pass to retrieve the longitude and latitude.

With the new v.3 of the maps API, you do not need a API Key anymore, which makes it a lot easier to move your solution between various environments, and to have the solution internal only (no IFD).

When calling the API, if your CRM is set to use HTTPS, use the HTTPS Google API URL, otherwise use the HTTP address.

Add in the header of your HTML web resource the reference to the JS library:

<script src="http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>

In this example I am using HTTP.

In your HTML web resource, first function you want to call on page load is a function that takes the value of the address fields, and concatenates it all into a string. It will be along the lines of:

var _address = street + city + province + country + postalCode;

check and use only the fields where you have a value populated.

Once you have this address as a string, pass it to the first function that converts the address into latitude and longitude. This will look as follows:

ParseAddress: function(address) {
    var url = "
http://maps.googleapis.com/maps/api/geocode/json?" +
    "address=" + address +
    "&sensor=false"

    var xhr = base.createCORSRequest(‘GET’, url);
    if (!xhr) {
        alert(‘CORS not supported’);
        return;
    }

    // Response handlers.
    xhr.onload = function () {
        var text = xhr.responseText;
        var _start = text.indexOf("\"location\" :") + 12;
        var _location = text.substring(_start, text.indexOf("}", _start) + 1);

        geoCode.Initialize(_location);
    };

    xhr.onerror = function () {
        $("#message-area").append("Woops, there was an error retrieving server data.");
    };

    xhr.send();
},

This example is using CORS. CORS stands for “Cross-Origin Resource Sharing”, and for more details on CORS see the W3C documentation HERE.

This function makes a call to the Google API and on successful retrieval of data, calls another function called Initialize, passing the trimmed returned string that includes the location lat and lng.

The Initialize function takes this location, builds the map representation, sets the zoom on it, and drops a pin at the location provided by the coordinates:

Initialize: function (_location) {

    var jsonData = $.parseJSON(_location);
    var _bGeoLocation = new Array();
    _bGeoLocation = jsonData;
 

    var myOptions = {
        zoom: 16,
        center: new google.maps.LatLng(_bGeoLocation .lat, _bGeoLocation .lng),
        mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    // Draw the map
    var mapObject = new google.maps.Map(document.getElementById(“geolocation”), myOptions);
    // Place the marker
    new google.maps.Marker({ map: mapObject, position: userLatLng });

}

Et voila, now you have a map with a pin on it pointing to the record’s address.

image

Enjoy!

An email server profile stores configuration regarding the connection to an email server. At least one email server profile must be configured within each Organization.

In order to configure an email server profile, the user performing the configuration must be a System Administrator or have an equivalent role.

Follow these steps to configure a new Exchange email server profile:

Navigate to Settings > Email Configuration > Email Server Profiles

Click on New and from the drop-down select Exchange Profile

clip_image002

On the newly opened form, fill in the required fields as follows:

Name – give a meaningful unique name to the profile

Description – provide a description for this profile. Usually mention what this profile is meant to be used for, for example if it is meant to handle traffic from specific satellite offices, or if it is to be used for service accounts that need to send out emails only, etc.

Auto Discover Server Location – for an Exchange profile, you could try to leave the auto discover on Yes. Setting it to No allows you to specify configuration details for the Exchange server. These include web service address for Incoming and Outgoing Exchange server. You must use the Exchange Web Service URL (EWS).

clip_image003

In the Credentials section specify the type of authentication to be used. The available options are:

clip_image004

For Exchange server profile, the last option (Without Credentials) is not a valid setting.

If you selected Credentials Specified in Email Server Profile, you must provide a user name and password

clip_image006

Use Impersonation – this setting allows you to have Exchange impersonation configured to send and receive emails on behalf of other mailboxes. See the next section on how to configure Exchange impersonation.

Use same settings for Outgoing allows you to keep the same credentials, or specify new credentials for outgoing emails.

The Advanced tab allow you to fine-tune the settings.

clip_image008

In here you can override the default ports, specify authentication protocols, as well as set the number of maximum concurrent connections and pooling intervals. Adjust these settings as necessary based on the environment, in order to minimize the impact on the network performance.

Once the configuration is complete, save the record using the Save ribbon button.

You can set a profile as default by clicking on the Set as Default ribbon button.

Once a profile is created, you can start managing associated Mailboxes. On the left side, under Common click on Mailboxes. This will present a listing of all mailboxes associated to this profile. You manage mailboxes same way you would manage any other record in Microsoft Dynamics CRM. On the ribbon you have the options to add a New Forward Mailbox or an Existing Mailbox.

At odd times you will be faced with some of the confinements of the new UI. One example is using an Option Set at the bottom of a section. After publishing you find that the actual drop-down is only showing two lines at a time. This is an undesired effect of the new UI. You are confined to a container, and the dropdowns do not know to extend past the borders of the container they live in. Here is the design:

image

And here is what you end up with on the published form:

image

Indeed, not very user friendly, especially when your selection list is longer.

Of course, you could try to relocate the control somewhere up in the container, but what if that field makes logical sense to be at the bottom of that container?

The solution is quite simple, the friendly Spacer comes to the rescue. Take a Spacer and add it to the bottom of the container. Now your form designer will look like so:

image

And now the users can breathe easy, as they can see a proper drop-down with more lines:

image

Add as many spacers as needed until you get it looking the way you want. Be mindful of the blank space you create underneath though, don’t exaggerate.

Enjoy!

Just a quick note, for those implementations taking advantage of script customizations, if you are using

Xrm.Page.ui.getCurrentControl

when upgrading to UR2, remember to check your scripts. This method is now deprecated.

For more details see HERE.

Happy scripting!

UR2 for Dynamics CRM 2013 has been released. You can download it from HERE.

The Build # for this release is: 06.00.0002.0046

Some of the notable improvements include, in no particular order:

Support for Windows 8.1

Support for IE11

Full support for Safari on iPads

Fixes for a few scripting errors

Of course, there’s a much longer list of fixes, and they are all described HERE.

Enjoy!

This is another new feature of Dynamics CRM 2013. While in previous versions, we used to use JScript alerts to bring up field specific messages on forms, now we have two new functions available:

setNotification(“message”);

and

clearNotification();

So how do we use then, and what do they do?

First off, let’s bring up a message on a field if a condition is met, or clear it otherwise:

function SetCustomNotification(controlName, controlMessage)
{
    var field = Xrm.Page.getControl(controlName);
    var condition = [evaluate your condition here];
    if (condition)
    {
        field.setNotification(controlMessage);
    }
    else
    {
        field.clearNotification();
    }
}

Pass in strings for controlName and controlMessage.

Set your function on either the onChange event of the field, or on the onSave event of the form. If you set it on form save, it’s a good idea to stop the save if the condition fails and the message comes up.

And the end results is your custom message showing as below:

image

Enjoy!

This quick snippet comes in handy every now and then, and now it’s also tested for Dynamics CRM 2013.

Scenario:

I have a bunch of organizations, and a set of Organization Types. Let’s say, we have various client types, with various SLA’s.

In the Case entity, I want to show only the Organizations of specific type(s), that I can support through Cases.

Solution:

First off, create a new web resource if one is not already created for the Case entity.

Then, from the form load event, call this function which uses addPreSearch.

function preFilterLookupOrganization() {   
    Xrm.Page.getControl("control_name").addPreSearch(function () {
        addLookupFilter();
   });
}

This is from the SDK:

addPreSearch

Use this method to apply changes to lookups based on values current just as the user is about to view results for the lookup.

JavaScript 
Xrm.Page.getControl(arg).addPreSearch(handler)

Arguments
Type: Function to add.
Remarks
This method is only available for Updated Entities.

The argument is a function that will be run just before the search to provide results for a lookup occurs. You can use this handler to call one of the other lookup control functions and improve the results to be displayed in the lookup.

 

Next let’s build the handler. We’re building the filter query and add the filter to our control as such:

function addLookupFilter() {
    var myControl = Xrm.Page.getAttribute("control_name").getValue();

    if (myControl != null) {
        fetchXml = "<filter type=’and’><condition attribute=’customertypecode’ value=’1′ operator=’eq’/></filter>";
        Xrm.Page.getControl("control_name").addCustomFilter(fetchXml);
    }
}

Now, it’s all in the filter, and the current example only looks for one specific Organization type. You can build that fetchXml filter as complex as needed, either by pulling if from an advanced find, creating it by hand, or using a 3rd party tool.

Enjoy!

With CRM 2013 we have now the quick create forms. These can be helpful, or they can create more confusion. So, how do they work?

First off, when enabled, where do you see these? They’re in various places, but the most important ones are:

1. On the Global Quick Create button

image

2. From within an existing record, by selecting New

image

By default, the following entities are enabled for Quick Create:

Activities – Tasks, Phone Calls, Emails and Appointments

Entities – Accounts, Cases, Competitors, Contacts, Leads and Opportunities

Enabling a new entity for Quick Create, or disabling the Quick Create on an existing one is done quite simply by going to the entity properties, on the General tab, in the Data Services section.

image

Just check/uncheck the Allow quick create.

Now, how do we customize what we see on these forms?

An entity must be configured to Allow quick create so we can add the quick create forms.

On the entity, go to Forms. You will find now that you have two new form options besides the well known Main and Mobile form. The new options are Quick View Form and the Quick Create Form.

image

If a Quick Create Form is not already present, create a new one. Add the required fields on this form and save. Don’t forget to publish your changes.

Some of the limitations of these forms include:

  • all fields reside in a single tab
  • no images can be displayed on this form

What you can do with this form includes:

  • set your formatting as needed using single, two column and three column settings
  • add custom events triggered by TabStateChange event

image

NOTE: In order for an entity to show in the Global Quick Create, it must not only have “Allow quick create” enabled, but it also must have a Quick Create Form created.

Enjoy!

Images are a new feature of CRM 2013. We can now easily associate an image to a record. In 2011 we had to add images either as Web Resources and reference them, or create custom scripts to pull images associated to Notes and display them on the records. Now, by default, CRM adds the image fields to 24 out of the box entities, and enables them to 8 of them. They are, in no particular order:

  1. Account
  2. Contact
  3. Competitor
  4. Lead
  5. Product
  6. Published
  7. Resource
  8. System User

It is very easy though to enable these images on to our new custom entities. These are the steps to follow:

1. Create a new field of type Image. Be aware that only one field of type Image can be added to an entity.

image

2. Go to the entity’s General tab, and set Primary Image to the entity image field created.

image

3. Go into form customization, and in Form Properties check the box for “Show image in the form”

image

4. Navigate to the record, click on the image container, and associate an image. The images have to be less than 5Mb in size. The actual rendered image is 62×62 pixels on the entity form:

image

or 40×40 pixels for the user profile in the top-right:

image

Some limitations include the fact that location is fixed to top-left corner of the form, and there is no direct way to resize it.

Enjoy!

Data Grid “+” does either Add New or Add Existing

So, hypothetical situation, I need a data grid on a custom entity (call it Group) to allow me to add existing related records of Users.

image

Followed the steps as such:

  1. Go to User, add a new lookup field Group, and make it Business Required
  2. Go to the Group custom entity and add a data grid to Users
  3. Save and publish all customizations.

image

Now, the interesting behavior is that, once you navigate to Group, and click on the “+” sign to add a reference to a system user, you get prompted directly to create a new user. But that’s not what I want. I just want to associate an existing user to the Group.

Turns out that it matters a lot how you define the group lookup on the User form. Here’s how it works:

If the lookup to Group is defined as Business Required on the User form, then in the Group form data grid the “+” sign will create a New User record.

On the other hand, if the lookup to Group is defined as either Business Recommended or Not Required, then in the Group form data grid the “+” sign will open up a lookup field, allowing you to reference an existing User.

Just something to keep in mind when working with relationships.

Enjoy!

Check out my course [Video]

Dynamics 365 Customer Engagement Administration

Dynamics 365 Customer Engagement Administration

Check out my course [Video]

Configuring and Extending Dynamics 365 Customer Engagement

Configuring and Extending Dynamics 365 Customer Engagement

Check out my course [Video]

Getting Started with Dynamics 365 Customer Engagement

Reviewed Book

Implementing Microsoft Dynamics 365 for Finance and Operations

Implementing Microsoft Dynamics 365 for Finance and Operations

Reviewed Book

Microsoft Dynamics 365 Extensions Cookbook

Microsoft Dynamics 365 Extensions Cookbook

Check out my Book

Microsoft Dynamics CRM 2016 Customization - Second Edition

Microsoft Dynamics CRM 2016 Customization - Second Edition

Check out my Book

Microsoft Dynamics CRM Customization Essentials

Microsoft Dynamics CRM Customization Essentials

Check out my Book

Microsoft Dynamics CRM 2011 Scripting Cookbook

Microsoft Dynamics CRM 2011 Scripting Cookbook

Reviewed Book

Microsoft Dynamics CRM 2011: Dashboards Cookbook

Microsoft Dynamics CRM 2011: Dashboards Cookbook

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 607 other followers

Follow Dynamics 365 Wizardry on WordPress.com