Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

display parent field values in the child fields,display grandparent field values in the grandchild using plugin or javascript

(0) ShareShare
ReportReport
Posted on by 195

Hi friends,

I have 3 entities country,state and district.

State(child) entity has country(parent) lookup.country has 2 single line fields,i want to display 2 fields in child when country lookup is selected and saved.

next

In district entity I want to display country 2 fields when i select the state lookup.

district has state lookup.

How can we do it using plugin and Javascript??

Thank you!

*This post is locked for comments

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: display parent field values in the child fields,display grandparent field values in the grandchild using plugin or javascript

    Hello Barath,

    If my understanding is not wrong ,If you want to display two single line text value for country lookup you can simply modify your lookup view  from entity ->View , by adding another text field , so bot the text will display when you select the country.

    Just want to know your user will choose two different type  single line text value  for same  lookup? In that case I think it would be good if if you give flexibility to add as a sub grid data  or quick view form without writing any code.

    Hope this helps.

  • Alex Fun Wei Jie Profile Picture
    33,626 on at
    RE: display parent field values in the child fields,display grandparent field values in the grandchild using plugin or javascript

    Hi,

    why use code when the default feature can achieve what you wanted. :(

    if you insist to use javascript,

    call the web api to get the related fields from parent and set it to form.

    WebAPi

    community.dynamics.com/.../use-fetchxml-to-retrieve-data-from-ms-crm-2016-using-web-api

    Set Value

    msdn.microsoft.com/.../gg334409.aspx

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: display parent field values in the child fields,display grandparent field values in the grandchild using plugin or javascript

    To be honest there is no sense in this requirement but if you insist you can write JavaScript that will retrieve related fields from CRM. To make it easier you can use CRMRestBuilder - github.com/.../2.5.0.0

  • bharrath Profile Picture
    195 on at
    RE: display parent field values in the child fields,display grandparent field values in the grandchild using plugin or javascript

    yes,but my requirement is using plugin or Javascript.

    Thank you!

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: display parent field values in the child fields,display grandparent field values in the grandchild using plugin or javascript

    Hello,

    Have you considered usage of Quick View Forms?

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans