Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

I'm trying to add some js code to react to the change of a field located in the business process flow (header) but I can't find where to put my code..

$
0
0

Hi, as you probably guessed I am new to Microsoft Dynamics.

I've been trying to add a filter on a lookup depending on the option you chose in an option set, but I can modify that option set both from the business process flow located in the header and from the body of my form.

I tried adding an OnChange function to the field located in the body of the form, but I'm not sure it applies to the (same) field located in the business process flow in the header. My code was working before, when I didn't use the business process flow as a way to select the option from the business process flow.

Do you know how to add an OnChange function to a field located in the business process flow?

I also tried using "header_process_" but I didn't success..

Here is the code I used before:

function OnChangeOfExpertType() {
Xrm.Page.getControl("rta_expertname").addPreSearch(function () {
addLookupFilter();
});
}

function addLookupFilter() {
var expertise = Xrm.Page.getAttribute("rta_experttype").getSelectedOption().value;
if (expertise != null) {
fetchXml = "<filter type='or'><condition attribute='new_typedelexpert' operator='eq' value='" + expertise + "' />"+
"<condition attribute='new_typedelexpert2' operator='eq' value='" + expertise + "' />"+
"<condition attribute='new_typedelexpert3' operator='eq' value='" + expertise + "' />"+
"<condition attribute='new_typedelexpert4' operator='eq' value='" + expertise + "' />"+
"</filter>";
Xrm.Page.getControl("rta_expertname").addCustomFilter(fetchXml);
}
}

PS: Sorry if my english is bad


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>