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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to fetch address as I selected Customer Name.

(0) ShareShare
ReportReport
Posted on by

As i had Contact entity and I have created a custom entity as MyShopping.

In MyShopping I had one field as Contact Name , so as i select an contact name I just want to populate an Address related to an selected contact name through Javascript.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at
    RE: How to fetch address as I selected Customer Name.

    Hi Ajay,

    If you are using >9.0 Check our sample: http://himbap.com/blog/?p=2874

    If you are below <9.0 check this: http://himbap.com/blog/?p=1997

    Finally you can also write your own script using Rest Builder: github.com/.../CRMRESTBuilder

    Thanks

  • Community Member Profile Picture
    on at
    RE: How to fetch address as I selected Customer Name.

    As I had Contact Entity and MyShopping Entity, In MyShopping i have an Customer field of Customer Datatype in that I have my all Account Names as a Dropdown.

    As I select any Customer (i.e any Account Name from  DropDown) I should be able to fetch address associated with it , which is present in an Account Entity.

    So, I need to fetch an address from an Account Entity and Display in MyShopping Entity.

    And this I have to achieved by only Javascript without Api's .

  • Suggested answer
    Ak Negi Profile Picture
    320 on at
    RE: How to fetch address as I selected Customer Name.

    Hi Ajay,

    You can use SDK.REST  to retrieving account . You have to just pass custumer id to follwing query

    var customerID = Xrm.Page.getAttribute("parentcustomerid").getValue()[0].id;

    SDK.REST.retrieveRecord(

       customerID ,

       "Account",

       "Address1_City,Address1_Country,Address1_County,Address1_Fax,Address1_Line1,Address1_Line2,Address1_Line3",

       null,

       function (result) {

           var address1_City = result.Address1_City;

           var address1_Country = result.Address1_Country;

           var address1_County = result.Address1_County;

           var address1_Fax = result.Address1_Fax;

           var address1_Line1 = result.Address1_Line1;

           var address1_Line2 = result.Address1_Line2;

           var address1_Line3 = result.Address1_Line3;

       },

       function (error) {

            alert(error.message);

       }

    );

    First Add sdk.rest webresource on onload of Myshopping entity

    Run this script onchange of customer field of Myshopping entity.

    Thanks

    Arun Singh Negi

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at
    RE: How to fetch address as I selected Customer Name.

    You can use Rest Builder or check this sample for OData: http://himbap.com/blog/?p=868

    Thanks

  • Community Member Profile Picture
    on at
    RE: How to fetch address as I selected Customer Name.

    Hi Arun.

    Thanks for Your suggestion.

    I am unable to get an Sdk.Rest so can i get a solution which totally based on Javascript without api,adk,plugins.

    Can I get other solution without Sdk.

  • Suggested answer
    Iswarya Profile Picture
    1,347 on at
    RE: How to fetch address as I selected Customer Name.

    Hi,

    Another way is customization ,

    actually1:N relationship between your contact and Custom Entity so use field mapping in Relationship of the Entity

  • Suggested answer
    Iswarya Profile Picture
    1,347 on at
    RE: How to fetch address as I selected Customer Name.

    Hi,

    check this screenshot for mapping3125.Untitled.png

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
UllrSki Profile Picture

UllrSki 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans