Google Address Auto Complete for Dynamics 365 on Form Field


Google Address Auto Complete for CRM Form field

Download the HTML and CSS files from the GitHub (GoogleAddressAutoCompleteForDynamics365)

Get the API Key from Google Places and Replace “Google API KEY” with the API Key

API_Key

Edit the HTML for the CRM field you want the Address Auto Lookup. As CRM_Field_SchemaName_i and CRM_Field_SchemaName e.g. msdyn_addressname_i and msdyn_addressnameGoogleAddressHTMLCode

Add the HTML Web Resource on the CRM Form just below the Address Fields

GoogleAddressHTMLOnForm

Add Custom Parameter Data and Check the Visible by default

GoogleAddressHTMLGeneral

Go to Formatting Tab and edit number of rows to 1.

GoogleAddressHTMLFormatting

Add the following Code and call the function on Load of the Form. Change the Web Resource name of the CSS.

var addStylesForGoogleAddess = function () {

var head = window.parent.document.getElementsByTagName(‘head’)[0];

var link = window.parent.document.createElement(‘link’);

link.rel = ‘stylesheet’;

link.type = ‘text/css’;

link.href = “/WebResources/new_googleautocompletestyles“;

link.media = ‘all’;

head.appendChild(link);

};

 

Cheers!!!! 🙂

About Kishore Dhanekula

MS Dynamics CRM and .NET Architect
This entry was posted in CRM, Dynamics 365, MS Dynamics 365, MS Dynamics CRM 2016 and tagged , , , , , , , , , , , , . Bookmark the permalink.

2 Responses to Google Address Auto Complete for Dynamics 365 on Form Field

  1. Dion Vansevenant says:

    What do you mean by this:

    “Edit the HTML for the CRM field you want the Address Auto Lookup. As CRM_Field_SchemaName_i and CRM_Field_SchemaName e.g. msdyn_addressname_i and msdyn_addressname”

    I am trying to add this to my Contact Form in Dynamics CRM v9. The only field beginning with “msdyn” is “msdyn_gdproptout”.

    I would like Address 1 to be set to use the Lookup. Would l use “address1_addressid” (Primary Key) in place of “msdyn_addressname_i”?

    Or can I use “address1_composite” ?

    Thanks,

    Dion

    • Hi Dion,
      No need to have an attribute which start with msdyn. it can be any text attribute.

      For Contact entity:
      You can use “address1_composite_compositionLinkControl_address1_line1_i” isntead of CRM_Field_SchemaName_i.
      And delete the line which is after for loop.

      Add the HTML Web resource below the Address Composite field.

      And pass the following parameters in HTML:
      address1_line1,address1_line2,address1_city,address1_stateorprovince,address1_country,address1_postalcode

      Let me know if you need more help. I will send you the Sample solution which works for Contact after adding the Google Key in HTML

      Thanks:
      KD

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s