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)

Dependent Lookup Based on Hierarchy in a Custom Entity

(0) ShareShare
ReportReport
Posted on by

Hi all!

I'm trying to customize the product entity form and have some problems with two of the lookup fields. 

I have a custom entity called Grouping, which will group all items into different categorizations. For instance

5415.Capture1.PNG

The (child) category is called Pencil Rasps, and the parent group Tungsten Carbide. We have also created a hierarchy for all sub- and master groups. Four different sub groups can belong to one parent group.

4857.Capture2.PNG 

Now I want to use this in a lookup in my product Entity. First I want my first lookup field to look for the sub group (Pencil Rasps) and in the next field I want the Master group (Tungsten Carbide) to be dependent of my first choice, so it suggests or automatically fills in Tungsten Carbide.

7571.Capture3.PNG

How the system is set up now, is that the Sub Group and Master Group has the same kind of lookup field. You have to find the right category by going through a list of our 100 different categories (sub- and master groups in the same list).

Is it possible to filter the option so only the sub groups are shown in the first lookup, and the suggested parent group is shown in the second lookup?
How do I create the relationship between the two entities Grouping and Product? 

Appreciate all help and tips I can get. Thanks
Olivia

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Yadnyesh Kuvalekar Profile Picture
    4,102 on at
    RE: Dependent Lookup Based on Hierarchy in a Custom Entity

    Hi,

    This is possible as per below:

    On custom group entity you will have parent group which is lookup to same custom entity.

    On product entity, you will have two lookup fields as sub category and parent category.

    Add these two fields on form. From the form editor, go to parent sub category field's property and select filter records and select sub categories as relationship. That's it. Now when user will select sub category, parent category will show filtered data

  • Lund Profile Picture
    on at
    RE: Dependent Lookup Based on Hierarchy in a Custom Entity

    Hi,

    I've already tried that, but it doesn't work for some reason.

    7026.Capture2.PNG

    I get no results when I go to Master group:

    7026.Capture2.PNG

    Regards

    Olivia

  • Verified answer
    Yadnyesh Kuvalekar Profile Picture
    4,102 on at
    RE: Dependent Lookup Based on Hierarchy in a Custom Entity

    Hi,

    Sorry I missed that. But you are trying to filter parent data based on the child selected. This is not correct case (I feel). You should select parent first and then filter child records based on the same. To do so, whatever I mentioned above will work (I tried).

    Now, if you want users to select child record first and then filter parent, then the only option is to set parent lookup field when user selects child record. CRM will not filter parent data.

    You can use JavaScript to set parent data or use real time workflow.

    Also, can you tell why you want parent field's lookup on product? If you select child record, then you will always get parent at anytime, So it there any specific need you want parent to be selected on product record? Also, if you want it only for display purpose, you can use quick view forms.

    technet.microsoft.com/.../dn531145.aspx

  • Lund Profile Picture
    on at
    RE: Dependent Lookup Based on Hierarchy in a Custom Entity

    Hi,

    Thanks for your input - I changed the order so the parent field is selected prior to the child lookup. It works, so thank you very much.

    Next question however is if I can filter the parent field to only show parent records? Right now all child- and parent records are listed at once in the first look up. I only want those records highest up in the hierarchy if possible. Do you know how I could achieve that?

    Thanks!

  • Verified answer
    Yadnyesh Kuvalekar Profile Picture
    4,102 on at
    RE: Dependent Lookup Based on Hierarchy in a Custom Entity

    I didn't get it. Can you explain with an example?

    I assume you want to filter child records and don't want to show parent records in the same. You can achieve that by creating new view on grouping entity where parent field contains data and select that view on lookup field.

  • Lund Profile Picture
    on at
    RE: Dependent Lookup Based on Hierarchy in a Custom Entity

    Thank you! That answered my question. Many thanks for taking your time and helping me, you saved my day :)

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
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans