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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Displaying child records based on field selection on parent form

(0) ShareShare
ReportReport
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

I have the same question (0)
  • Suggested answer
    Mahadeo Matre Profile Picture
    17,021 on at

    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.

  • crmprogrammer2013 Profile Picture
    2,665 on at

    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.

  • crmprogrammer2013 Profile Picture
    2,665 on at

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

  • Suggested answer
    Mahadeo Matre Profile Picture
    17,021 on at

    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.

  • Suggested answer
    Community Member Profile Picture
    on at

    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. 

  • crmprogrammer2013 Profile Picture
    2,665 on at

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

    Thank you.

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Shidin Haridas Profile Picture

Shidin Haridas 2

#1
SA-08121319-0 Profile Picture

SA-08121319-0 2

#1
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans