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

Applying lookup filter when option set value equal is 1

$
0
0
The scenario is, there is one option set field, and when I select option set value based on that  a lookup value should filter
function Tipologiaintervento(executionContext)
{
    debugger;
   var formContext=executionContext.getFormContext();
 if(formContext.getAttribute("new_tipologiaintervento").getValue!=null){ 
    var tipologiainterventoformContext.getAttribute("new_tipologiaintervento").getValue();
    if (tipologiaintervento == 1 )
        {
         formContext.getControl("msdyn_workordertype").addPreSearch(filterlookup());
        }
    else
        {
         formContext.getControl("msdyn_workordertype").removePreSearch(filterlookup());
        }
    } 
}
function filterlookup()
{
    debugger;
   
    var fetchxml = "<filter type='and'>"+
    "<condition attribute='msdyn_workordertype' operator='eq' value='03A27F86-75C7-EB11-BACC-000D3A26E00B'/>"+
    "<condition attribute='msdyn_workordertype' operator='eq' value='E4997BC9-6DBC-EB11-BACC-000D3A4980A5'/>"+
    "</filter>";
 formContext.getControl("msdyn_workordertype").addCustomFilter(fetchxml);
}

Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images