Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Displaying child records based on field selection on parent form

Posted on by 2,665

Hi,

I am just trying to find ideas and see if there is any possibility to implement this below scenario.

Can we set up a form with some fields and based on one of the field value selection, show all the related records(child records for instance).

Is this possible? Please let me know if the question is not clear. I am imagining a setup more like 'Advanced find' but can't use it as we may extend further more based on the requirements.

Thanks for any help. 

*This post is locked for comments

  • crmprogrammer2013 Profile Picture
    crmprogrammer2013 2,665 on at
    RE: Displaying child records based on field selection on parent form

    @Dilbagh - Isn't that for lookup field filtering? I am trying to filter on a subgrid.

    Thank you.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Displaying child records based on field selection on parent form

    You can achieve this by using addPreSearch and addCustomFilter methods by passing value from one field to fetch query.

    Using addPreSearch method you can specify a handler to PreSearch Event. Inside the handler you can specify your fetch xml query that can be used for filtering child records.

    The filter applied in the fetch xml will be combined with the any previously added filter as an 'AND' condition.

    To remove the filter we can use removePreSearch method.

    Syntax

    formContext.getControl(arg).addPreSearch(myFunction)

     e.g.

    Filtering the primary contact lookup to show only those records starting with S in the account form. 

  • Suggested answer
    Mahadeo Matre Profile Picture
    Mahadeo Matre 17,021 on at
    RE: Displaying child records based on field selection on parent form

    Hi,

    If it is on CRM entity form and want to filter sub grid, then there are some unsupported JavaScripts.

    nishantrana.me/.../unsupported-filtering-of-subgrids-in-dynamics-365-crm-2016

    community.dynamics.com/.../236817

    otherwise, use JavaScript, HTML webresoruce and CRM web API to create your custom search page and retrieve records based on values using API.

  • crmprogrammer2013 Profile Picture
    crmprogrammer2013 2,665 on at
    RE: Displaying child records based on field selection on parent form

    Any reference to the similar feature articles would be helpful. Thanks again.

  • crmprogrammer2013 Profile Picture
    crmprogrammer2013 2,665 on at
    RE: Displaying child records based on field selection on parent form

    in particular entity want custom search based on values selected - it is.

    Yes, based on country or location like you said, pick all the random contacts that matches the criteria. And then probably be able to select one of the retrieved records and move through the next steps of the workflow which we are not sure of yet. For time being, we would like to have a base to start the work with.

    Thanks for the quick response.

  • Suggested answer
    Mahadeo Matre Profile Picture
    Mahadeo Matre 17,021 on at
    RE: Displaying child records based on field selection on parent form

    Hi,

    Do you want to implement custom search  page? or in particular entity want custom search based on values selected.. eg. show contacts for account when location city is selected or country is selected etc.

    You can achieve all this using JavaScript code.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans