Search code examples
dynamics-crmdynamics-crm-onlinedynamics-crm-365

BPF Filtered lookup field not working in certain stages


In my case same lookup field in BPF for two more stages in a process which is working in stage1 and not working in stage2 and stage3.

 function Filter(executionContext) {
    debugger;
    var formContext = executionContext.getFormContext();
    var control = Xrm.Page.getControl("header_process_attributename");
    if (control) {       
        formContext.getControl("header_process_new_attributename").setDefaultView("{**View Guid**}");

    }
}

Solution

  • It is working by using following code:

    Need to change attribute name as follows

    Stage 2:

    var control = Xrm.Page.getControl("header_process_attributename_1");
    

    Stage 3:

    var control = Xrm.Page.getControl("header_process_attributename_2");