web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Lookup address by ZIP Code - updated 20170510

(0) ShareShare
ReportReport
Posted on by

Hello,

I have been trying to implement the solution found at: https://community.dynamics.com/crm/b/hardworkdays/archive/2013/05/07/microsoft-dynamics-crm-2011-lookup-address-by-zip-code, with no success.

Environment:

Windows 8.1, browser Firefox 53.0.2, Dynamic CRM 2016

Steps taken:

  1. Created script in Web Resources named Addres.Lookup.js; the content of which is the same from the link above.  Also, created another new Web Resource  using compressed version of jquery.3.2.1.
  2. Instead of using the composite address, I added a separate field on the Account form for Address 1:Zip/Postal Code.
  3. Configured OnChange handler for the separate Zip Code filed added; see attached.
  4. I get an error message

OnChange-and-Display-Zip_5F00_Postal-Code.PNG

Thanks to Nithya Gopinath, who set me on the right track to troubleshoot the issue.  Using debug mode, I verified that the script worked until the "getJSON" statement.  The picture below depicts the yellow highlighted code that was being executed with the script failed.  I put a watch on the variable "Address" and it was never defined. 

AddresLookup.js_5F00_2ndPic.png

Thank you in advanced for your input.

All the best,

Lannie

*This post is locked for comments

I have the same question (0)
  • Nithya Gopinath Profile Picture
    17,078 on at

    Hi,

    Please try debugging the javascript code by putting the keyword debugger as shown below to know the errors in the script.

    Resolve: function () {
                debugger;
                Xrm.Page.getAttribute("address1_country").setValue(null);   

    See: http://crmbook.powerobjects.com/extending-crm/javascript/debugging-javascript-libraries/

    Hope this helps.

  • Community Member Profile Picture
    on at

    Giving you some other perspective of the issues.

    Try to check whether you have any connection issue to connect to google?

    >>The code might be just fine but the connectivity might be causing it? How about add the google URL to the trusted site?

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Looks like issue you experience is related to unavailability of jQuery. Doublecheck that you added jQuery to form and published webresource (I had the same issue when I was working on workaround for you).

    So here is how I made it work in FireFox:

    1. Open your CRM application (like https://somecrm.crm.dynamics.com) in Firefox.

    2. Change ZipCode to cause cross-domain call (this time you will not see that something really happened).

    3. Click on sign close to url and in popped up window - ">" button:

    FirefoxTrick1.png

    4. Click "Disable Protection for now" button:

    FirefoxTrick1.png

    5. Reload form and try to update Zip Code again. That worked for me:

    FirefoxTrick2.png

    Good luck!

  • Community Member Profile Picture
    on at

    Hi LanCru5,

    Looks like the third screenshot is giving information about an error because of wrong keyword - "Debugger"

    The keyword is "debugger;" not "Debugger".

    Can you try that if your issue has not resolved yet? Please let us know what you got.


    Thanks,

    Charmis

     

  • Nithya Gopinath Profile Picture
    17,078 on at

    Hi,

    Just put debugger; not Debugger at the start of the function as mentioned in my thread above.

  • Suggested answer
    Community Member Profile Picture
    on at

    Found the problem...  I changed the url  for maps.google.com to call a secure site:

    maps.google.com/.../json;components=country:US|postal_code:

  • Community Member Profile Picture
    on at

    Happy New Year Andrew,

    I implemented your "Lookup Address by Zip code" script.  Recently, the script began to fail.  When execute the script using debugger it reports that "Slickdata" does not exist.  Has something changed in the use of the instance method?

    Thank you,

    Lannie

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Code should work as it worked before.

  • Joseph Melillo Profile Picture
    125 on at

    Hello, 

    Does anyone know how to make this work with Composited Fields?? 

    Joseph

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans