Related field fixed relation in table for custom lookup

Requirement

How to create Filter-specific Lookup field for a control in table level.

Scenario: Suppose we have a master table which consists of list of colours in it, and this table is used in lookup field in the required table/forms and it gives a drop down of all the list of colours in the table. 

There is a column in the table where we can deactivate the colour. If the colour is deactivated, then it shouldn’t be displayed in the Lookup field.

To resolve this issue we can follow the steps below.


High level resolution steps 

Create a “Related Field” with a fixed relation to the field based on which the filtering should occur.


Detailed resolution steps

To establish relationships and enable filtering based on a specific field, follow these steps:

  •  Identify the table or tables where the lookup field is present.
  •  Navigate to the identified table(s).
  •  Locate the field that will be used as the basis for filtering.(Ex: Deactivated)
  •  Create a relation between the lookup field and the filtering field.
  •  This relation establishes a connection between the two fields, allowing for data association and filtering.

Once the relationship is established, you can now filter data based on the values in the filtering field.


Output

When all the colours are activated.

It display all the colours in the dropdown list/Lookup field. 

When some particular colours are deactivated, 

It doesn’t display the deactivated colours due to the relation created in the tables. 


Blog written by   

Ramcharan Raj Pallavarapu | Dynamics 365 for Operations team.


/* H1 style */ h1 { font-size: 24px; /* Adjust the size as needed */ font-weight: normal; /* You can use 'bold', 'lighter', 'bolder', or a number */ } /* H2 style */ h2 { font-size: 20px; /* Adjust the size as needed */ font-weight: normal; /* Adjust the weight as needed */ } /* H3 style */ h3 { font-size: 18px; /* Adjust the size as needed */ font-weight: normal; /* Adjust the weight as needed */ }