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

hide subgrids on form load

$
0
0

Hi All,

I want hide the subgrids based on option set, but this optionset is updated through integration.

I know that we can write the  js and register on load of form and on change of optionset, but for some reason I cant seem to achieve my requirement and below is my code

function hidesubgrid(executionContext)
{
var formContext = executionContext.getFormContext();// get the form Context

if(formContext.getAttribute("xxxx_xxxx_status").getValue() == 0 || formContext.getAttribute("xxxx_xxxx_status").getValue() == 1 )
{
formContext.getControl("xxxxxxxsubgrid").setVisible(false);//Hide Subgrid
formContext.getControl("yyyyyyysubgrid").setVisible(false);
}
else if(formContext.getAttribute("xxxx_xxxx_status").getValue() == 2)
{
formContext.getControl("investmentsubgrid").setVisible(false);
}
}

Regards,


Viewing all articles
Browse latest Browse all 79901

Latest Images

Trending Articles

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>