I have created this postcode lookup solution. You can download the managed solution from here. The name of the solution file is PostCodeSolution_1_0_managed. The solution consists of 4 files
- new_Json2.js (Javascript webresource)
- new_PostCodeScript(Javascript webresource)
- new_postcode(custom entity to store postcode information)
- new_SuburbOptions (HTML webresource)
How does it work:
- User enters the postcode on postal code field and onchange event of the field, the solution will retrieve postcode records related to entered postcode.
- If there is a record related to entered postcode, the solution will populate the state, suburb and country fields for you.
- If there are more than one records related to entered postcode, solution will prompt you to select the appropriate entry.
In the following screen shot, I entered 2000 in postal code field and system prompt to pick the relevant city/suburb.
Pros:
- Clean data entry: The solution will help to minimise data entry errors in address fields.
- Don’t need to create custom picklist state/or country attributes.
- Using built-in address fields means, don’t need to modified some of the built-in reports.
Cons:
- The solution is working only address1_postalcode attribute of an entity. It can work on account , contact or any other entity that has built in address fields.
- The solution is hard coded to fill built in adress1_city, address1_stateorprovince, address1_country fields only.
Version 2.0 :
I will release version 2.0 soon, which will not use hard coded attributes.
Installation Directions:
- Install the postcode solution.
- Open the account or contact entity form in customisation mode.
- Double click on Postal Code attribute.
- Add new_Json2.js and new_PostCodeScript to form libraries.
- Call loadPostCodeRequest function from new_PostCodeScript.Save the changes and publish them.
6. Import the Postcodes.
- For Australia go to http://auspost.com.au/products-and-services/download-postcode-data.html and download the Australian postcodes in csv format.
- Remove the unwanted columns from the .csv file and rename some of the column headings. The file should look this
- Import the file into new_postcode entity.
Note: You can download the US postal Codes from US ZIP CODES.
You are good to go.
Feedback please.
Hi..
ReplyDeleteI am having trouble getting this script to work.
If I implement as you write it says "The value of the property 'loadPostCodeRequest' is null or undefined, not a Function object".
I am deploying on CRM 2011 online enviroment. Please advice.
Thx
Rune Daub
Hi Rune,
ReplyDeleteI update the solution file. Try it again. It will work this time.
Just make sure you are referring new_PostCodeScript without "s" at the end and not new_PostCodeScrips.
Now getting an error saying:
ReplyDelete"Unable to get value of the property 'getEventSource' is null or undefined"
Hi Rune,
ReplyDeleteI tested this solution on CRMOnline and its's working perfectly fine. There must be some other issue.
HI, I tried this in a 2011 online install and when the onchange kicks in, it gives the following error:
ReplyDeleteThere was a problem with this field's customized event.
Field:address1_postalcode
Event:onchange
Error:'undefined' is null or not an object
Any clues, thank you, Angus
Sorry, last post I meant On Premise install!.
ReplyDeleteWe got the same error with our On-Premise Install.
ReplyDeleteField:address1_postalcode
Event:onchange
Error:'undefined' is null or not an object
When changing the event handler and enabling (ticking) the "Pass execution context as first parameter" the error changes to the following:
Field:address1_postalcode
Event:onchange
Error:Access is denied
Any clues Singh ??????????
Hi Try using the proper url to start a crm like
ReplyDeletehttp://crm2011:5555/crm5.
Don't use http://localhost:5555/crm.
It takes a bit of a time the first time. After that it will be ok.
Change the event handler and tick the "Pass execution context" as first parameter
ReplyDeleteHi, we could use this if it was using configurable attributes and worked with UK postcode data.
ReplyDeleteHow is that version 2.0 coming on or has development stopped
thanks
Paul
pbenfield@soilassociation.org
Hi Paul,
DeleteI think, I already sent you an email about it. I will post the code in April.
Regards,
Microsoft Dynamics CRM training will help you manage and prioritize your business goals, customize.we teach MS Dynamics CRM training and class available at Hyderabad.
ReplyDeleteHi,
ReplyDeleteWill this work with a US version of CRM 2011 online after the latest update on 10 Jan 2013?
Howard
Yeah It should work with all versions of CRM2011.
DeleteHI When I Update an existing record and when changing the Postcode - I get the Pop up with the suburb list and when selected it updates the reqquired fields except for City. City field is blank . Kindly advice.
ReplyDelete