Adding Postcode Lookup to Microsoft Dynamics CRM
This quick tutorial demonstrates how you can add full postcode lookup functionality to your Microsoft Dynamics CRM
installation in a matter of minutes. To get started, download the
sample Microsoft Dynamics CRM Postcode Lookup code that accompanies this tutorial.
Overview
This sample comprises two parts - a web service that runs alongside your Microsoft Dynamics CRM installation to
provide a gateway to our Postcode Lookup web service, and a
set of Javascript code that can be used to customise each of the major default Microsoft Dynamics CRM forms that
include address information. These scripts call the web service to retrieve the full address details when the user
enters a postcode in the CRM form, and allows the user to select a corresponding address.
Installation
-
Download the sample code and extract it into a new folder on
your CRM server, e.g. C:\Program Files\Data8\Microsoft Dynamics CRM.
-
In IIS Manager, create a new virtual directory called "Integr8CRM" within the Microsoft Dynamics CRM web site,
and map it to the folder containing the sample code. Allow scripts to run within the virtual directory.
-
Edit the web.config file to include your username, password and licence type. If you are unsure of any of these
details, please consult your Data8 account manager.
-
From the Microsoft Dynamics CRM "Customize Entities" screen, edit the Account entity type. Under the "Forms and Views"
section, edit the main Form.
-
Select the postcode field on the form and click Change Properties. Go to the Events tab, select the "onChange" event
and click Edit.
-
Tick the "Event is enabled" box, and copy and paste the code from the "javascript\accounts.js" file found in the
sample folder into the script editor. Click OK twice to return to the form editor, click "Save and Close" twice to
return to the "Customize Entities" screen, and click Publish to finish the process.
The Account entity has now been fully configured to allow addresses to be entered rapidly using only the postcode. To test it,
create a new account and enter a postcode. Press Tab or click outside the postcode box, and the new "Address Lookup" screen
will appear listing the available addresses within that postcode. Select an address from the list and click OK to enter the address
into the account form. If only one address is available in the selected postcode it will be entered automatically without
displaying the "Address Lookup" screen.
Sample scripts have also been provided with the sample code to allow customising the Contact, Lead and Address entities in the
same way - simply repeat the final three steps from the above list for each entity, using the appropriately named script from
the javascript folder each time.