Hi,
I have to filter a lookup on a Business Process Flow. I have used the code to filter on the lookup field Truck Sales Area. The code is triggered on on-Load. I Always get an error ff the stage where the lookup exists is not active. I want the code to be triggered once a specific stage named 'Add Company Details' is selected
function formonload() {
preFilterTruckSalesArea();
}
function preFilterTruckSalesArea() {
Xrm.Page.getControl("header_process_new_areaid").addPreSearch(function new_areaid() {
var fetchXml = "<filter type='and'><condition attribute='new_areacode' operator='eq' value='1'/></filter>";
Xrm.Page.getControl("header_process_new_areaid").addCustomFilter(fetchXml);
});
}
Any suggestions.
*This post is locked for comments