POWEROBJECTS

718 Washington Ave. N. Suite #101
Minneapolis, MN 55401
View map and all Locations

Send us a message

Microsoft Dynamics CRM 2016 introduced two new CRM client-side API additions: Web API and Autocomplete. In today’s blog, we will go over both of these new features and show you how they can be used. Let’s get started!

crm-2016

Web API

The Web API is replacing the Organization Service. It implements OData v4, which allows the same operations as the Organization Service without needing CRM SDK assemblies. This is a BIG deal, as complex applications can be created across a variety of platforms and programming languages without the limitation of OData v2 CRUD only operations. Actions and Functions are operations performed via HTTP requests. The Organization Service (OData v2 REST endpoint) has been deprecated for CRM 2016.

Here is where you find the new Web API URL: Settings Ă Customizations Ă Developer Resources.

Web API and Autocomplete

Want to learn more about the new Web API? Check out this blog post!

Autocomplete

Autocomplete was added to the API in Dynamics CRM 2016. It provides a quick and easy way to pick a value from a predefined list, improves the user experience in forms, and helps with data quality in the system.

In out-of-the-box CRM, the Address fields are all plain text. Country, State and Zip Code fields are good candidates for autocomplete fields. In the steps below, we will demonstrate how to retrieve Countries from a custom entity via the Web API and display it on an autocomplete field. Autocomplete data source is not limited to custom entities. External sources can be used as well.

The setup: Country entity with Name and Country ISO Code fields:

Web API and Autocomplete

Register the loadAutoComplete function in the Form Load event:

Web API and Autocomplete

The code: The function below retrieves all Country names and codes, sorted by country name, form the custom po_country entity and calls the autoCompleteCountries function passing the list of countries as a parameter.

Web API and Autocomplete

The function autoCompleteCountries is implemented with the code below. The autocomplete feature is simple to use, but please note that two methods and one event handler are needed: addOnKeyPress, showAutoComplete and hideAutoComplete.

  • showAutoComplete: Displays the autocomplete drop-down field when there is a match between what the user typed in the Address1: Country/Region field and any Country name or ISO code.
  • hideAutoComplete: Hides the autocomplete drop-down field when no matches are found.
  • addOnKeyPress: The keyPressFcn is called every time a user types a character in the Address1: Country/Region field.

Web API and Autocomplete

This is what it all looks like in action:

Web API and Autocomplete

Check out the video here to see it all in action:


That’s all for the blog today! Keep coming back for more information on the great new features of Microsoft Dynamics CRM.

Happy CRM’ing!

Avatar for JoeCRM

JoeCRM

Joe CRM is a CRM superhero who runs on pure Microsoft Dynamics CRM adrenaline. As the face of PowerObjects, Joe CRM’s mission is to reveal innovative ways to use Dynamics CRM and bring the application to more businesses and organizations around the world.