Sunday 17 June 2018

Filter Lookup without script



Requirement

On Account form we have Country, State and City lookup fields that should be filtered depend upon selection
For E.g. If India selected in country lookup field then states from India only should be visible for selection in State lookup field, and same will be apply to City depend upon selection in state.

Solution

MSCRM has provided functionality for related record filtering for lookup field on form, in that we gets common N:1 relationships of form’s entity and of lookup entity for configuration

Now we don’t have any filtration on State as per country hence we are getting all available states for selection without considering the country selected in Country fields


So let’s start work on the above requirement
  • Open Account Form for changes
  • Open Property of State field on form and slide down to Related records Filtering section

  • Check on “Only show records where” checkbox it will enable drop-down list for selection
  • First drop-down list gives N:1 relationships of entity form, here we have to select the field which is  going to be used for filtration, In our example we want state filtration as per country, so let’s select Country of Account

  •  Second drop-down list shows N:1 relationships of lookup entity and auto fill as per selection in first drop-down list
  • In our case we have only one N:1 relation of State entity with country entity hence we are not getting multiple options for selection in second drop-down list



  • Keep “Users can turn off filter” check box as uncheck
  • After making changes click on “Ok” to save property changes for state field
  • Select below options for City filtration as we required city should be filtered as per selected state


  • After making changes for field’s property Save and Publish
  • Refresh and check for the output
 You will get output like below
On selection of India in country field will get only those states which are in India



After selecting MH in State only cities in Maharashtra will be available for selection


Happy Learning ðŸ˜Š

No comments:

Post a Comment