Hi,
I have a business process flow that seem to only work if the field (Reason) that I need to do the FILTER lookup on exist in the first stage.

When I remove the Reason field from the first stage to the second stage the FILTER no longer works.

The below logic is working on the first stage.
if (Xrm.Page.getControl("header_process_new_reasonid") != null) {
Xrm.Page.getControl("header_process_new_reasonid").removePreSearch(addLookupFilter);
Xrm.Page.getControl("header_process_new_reasonid").addPreSearch(addLookupFilter);
}
I thought if I added the below logic to trigger on a stage change using OnLoad or OnSave still no luck.
Xrm.Page.data.process.addOnStageChange(stageChange);
Xrm.Page.data.process.addOnStageSelected(stageChange);
function stageChange() {
Xrm.Page.getControl("header_process_new_reasonid").addPreSearch(addLookupFilter);
}
Does javascript logic only work on the first stage.
Any ideal on what I am doing wrong.
Thanks
*This post is locked for comments
I have the same question (0)