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 :
Customer experience | Sales, Customer Insights,...
Answered

Restrict value of field/or option set based on another field from a separate entity

(0) ShareShare
ReportReport
Posted on by

Hi

I'm attempting to have 2 fields, one is an account name, and the other is a custom Category field.

The entity is Opportunity.

This custom Category field has also been added to the Account entity for each account.

The aim is to select a Category drop-down value, in Opportunity entity, and then have the next field (account name) to be restricted only to those accounts who are part of that category.

Can I do this on D365?

  • ETconsultant Profile Picture
    on at
    RE: Restrict value of field/or option set based on another field from a separate entity

    In other words...

    I want to select "Electrical" in the Category field in the Opportunity form. And then I want the next field, Account name, to yield only those Accounts that are part of that category..

  • Suggested answer
    Bipin D365 Profile Picture
    on at
    RE: Restrict value of field/or option set based on another field from a separate entity

    Hi,

    Account Name is lookup field then you can use javascript to filter the result

    docs.microsoft.com/.../addcustomfilter

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Restrict value of field/or option set based on another field from a separate entity

    Hi ETconsultant: 

    There is one OOB property in the lookup field--Related Records Filtering,which can help you achieve the goal:

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/customize/special-field-properties-legacy?view=op-9-1#lookup-field-properties 

    Navigate to Settings > Customizations > customize the system > Entities > Opportunity > Forms to open the main form, then double-click the account lookup field:

    --In Related Records Filtering section, you can set it as following screenshot:

    pastedimage1657680277951v1.png

    Test:

    pastedimage1657680983218v2.pngpastedimage1657681014656v3.png

  • ETconsultant Profile Picture
    on at
    RE: Restrict value of field/or option set based on another field from a separate entity

    Thank you so much Leah, I think this is the missing part.

    The only issue I still face is in the dropdown options under Related Records Filtering. They are too limited so I can't choose the appropriate options, which based on my example above, would look very similar to your example above.

    I think the problem is I have faced difficulty in linking/mapping the 'Category' field in the Opportunity entity to the Category field in Account entity.

    Any idea how to do this?

  • Community Member Profile Picture
    on at
    RE: Restrict value of field/or option set based on another field from a separate entity

    Hi ETconsultant,

    1.You need make sure that the category is one lookup field.

    2.Could you share screenshot about problem?

  • Suggested answer
    KK-365 Profile Picture
    on at
    RE: Restrict value of field/or option set based on another field from a separate entity

    If the Custom Category is a Custom Entity, and the Custom category field on Account is a Lookup field.

    Also, the custom category field on opportunity field is a lookup field, then the solution suggested below by Leah Ju, should work for you.

  • ETconsultant Profile Picture
    on at
    RE: Restrict value of field/or option set based on another field from a separate entity

    Thanks for this information. I worked it out myself, that what I missed was that relationships are between entities so I need to create a custom entity in order for the 'category' relationship lookup to work properly.

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 > Customer experience | Sales, Customer Insights, CRM

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans