Answered by:
CRM 2011 - LookUp Data

Question
-
Hi
We have data in excel sheet for Zip,City, State. When user enters a zip on form then City and State should auto populate. We can dump excel sheet data in one entity as records. But how can we populate City, State onChange of Zip?
Any thoughts/Suggestions?
Thanks
Monday, September 26, 2011 2:39 PM
Answers
-
Hi,
CRM by default have text fields for Zip, City, State in Account, Contact, Lead entities etc..you might have to create entities. If to auto pupulate the data on excel import the you have to develop a plugin register on Pre-Create Cperation for Cretae Message that will retrieve the City, State etc fields via RetrieveMultiple webservice call from the Zip code entity and then can set in to the entity fields i.e. Account entity fields
Follow the steps:
1. Create the Zip Code Entity (Settings->Customizations->Customize the System->Entities->New) which can contain (Country, City, State fields, if you will create country, city, state new fields then new lookup fields (new custom entities for State, City etc and then related with a Zip code entity) will not be used by Outlook and will not syncrhonize with Outlook contatcs)
2. Create Zip Code Entity 1:N relationhip (Settings->Customizations->Customize the System->Entities-> Zip Code->1:N Relationship, click on new button and select Account in drop down) with entity (i.e. Account) where you want to select the Zip Code lookup
3. Place Zip Code lookup field on Account Entity Form (Settings->Customizations->Customize the System->Entities-> Account->Form->Main, Drag the new lookup field Zip Code on form, save form and then Publish entity)
4. On Zip Code lookup On Change event write JScript SOAP SDK or REST retrieve code (Can reffer the sample code:http://worldofdynamics.blogspot.com/2011/06/microsoft-dynamics-crm-2011-retrieve.html) or (http://mileyja.blogspot.com/2011/03/crm-2011-retrievemultiple-calls-in.html) to retrieve fields Country, City, State fields from the Zip Code entity and assign them to Account entity fields
5. Publish Entity Customizations
Jehanzeb Javeed
http://worldofdynamics.blogspot.com
Linked-In Profile |CodePlex Profile
If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
- Proposed as answer by Jehanzeb.Javeed Monday, September 26, 2011 3:12 PM
- Edited by Jehanzeb.Javeed Monday, September 26, 2011 3:13 PM
- Marked as answer by myCRMGuy Monday, September 26, 2011 5:57 PM
Monday, September 26, 2011 3:12 PM
All replies
-
Hi,
CRM by default have text fields for Zip, City, State in Account, Contact, Lead entities etc..you might have to create entities. If to auto pupulate the data on excel import the you have to develop a plugin register on Pre-Create Cperation for Cretae Message that will retrieve the City, State etc fields via RetrieveMultiple webservice call from the Zip code entity and then can set in to the entity fields i.e. Account entity fields
Follow the steps:
1. Create the Zip Code Entity (Settings->Customizations->Customize the System->Entities->New) which can contain (Country, City, State fields, if you will create country, city, state new fields then new lookup fields (new custom entities for State, City etc and then related with a Zip code entity) will not be used by Outlook and will not syncrhonize with Outlook contatcs)
2. Create Zip Code Entity 1:N relationhip (Settings->Customizations->Customize the System->Entities-> Zip Code->1:N Relationship, click on new button and select Account in drop down) with entity (i.e. Account) where you want to select the Zip Code lookup
3. Place Zip Code lookup field on Account Entity Form (Settings->Customizations->Customize the System->Entities-> Account->Form->Main, Drag the new lookup field Zip Code on form, save form and then Publish entity)
4. On Zip Code lookup On Change event write JScript SOAP SDK or REST retrieve code (Can reffer the sample code:http://worldofdynamics.blogspot.com/2011/06/microsoft-dynamics-crm-2011-retrieve.html) or (http://mileyja.blogspot.com/2011/03/crm-2011-retrievemultiple-calls-in.html) to retrieve fields Country, City, State fields from the Zip Code entity and assign them to Account entity fields
5. Publish Entity Customizations
Jehanzeb Javeed
http://worldofdynamics.blogspot.com
Linked-In Profile |CodePlex Profile
If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
- Proposed as answer by Jehanzeb.Javeed Monday, September 26, 2011 3:12 PM
- Edited by Jehanzeb.Javeed Monday, September 26, 2011 3:13 PM
- Marked as answer by myCRMGuy Monday, September 26, 2011 5:57 PM
Monday, September 26, 2011 3:12 PM -
As you suggest, first off all you have to import attributes city and state into zip entity. Then, you can get city and state for a zip code in onchange event just making a REST call to zip entity, get city and state attributes and fill in attributes in the form (JavaScript). If you need more information on how you can do this REST call, do no t hesitate to ask me.
Hope this helps.
Albert PorraMonday, September 26, 2011 3:12 PM -
Ooops! I do not see Jehanzeb answer while I was writing my answer. He gave you a more extended explanation of what I was suggesting.
Albert PorraMonday, September 26, 2011 3:17 PM