locked
Based on lookup value hiding the section with grid RRS feed

  • Question

  • Hi All,

    I want ot hide the grid based on lookup value , please help me .

    Thanks in advance;

    Thursday, May 15, 2014 6:48 AM

Answers

  • Hello,

    Try like below

    if(Xrm.Page.getAttribute("Lookupfieldname")!=null && Xrm.Page.getAttribute("Lookupfieldname").getValue()!=null)//change lookup field
    {
    var control = Xrm.Page.ui.controls.get("yourgridname");
        if(control!=null)
        {
            if(Xrm.Page.getAttribute("Lookupfieldname").getValue()[0].name=="YourValue") //compare with your text
            { control.setVisible(false); }
            else
            {control.setVisible(true);}
        }
    }


    Our Website| Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Thursday, May 15, 2014 7:17 AM
    Moderator