Filter lookup using javascript based on first lookup

Filter lookup using javascript based on first lookup

Hi,

I am looking to filter nexted lookup in dynamics crm based on first lookup selected value using javascript. Is there way to achieve this functionality.

  • This topic was modified 3 months, 2 weeks ago by  dynamics.

1 ANSWERS

February 5, 2018 at 2:32 pm dynamics

Hi,

Yes, it is possible to filter lookup value and add filter using javascript in dynamics crm.

To filter this we use the following code, and call the “firstLookupSelected” function when select completed for first Lookup:

function firstLookupSelected() {

addLookupFilter();
}

function addLookupFilter() {
var firstValue= Xrm.Page.getAttribute(“firstLookUp”).getValue();

if (email != null) {
fetchXml = ““;
Xrm.Page.getControl(“scoentLookUp”).addCustomFilter(fetchXml);

}
}

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.