Quantcast
Channel: Sam's Activities
Viewing all articles
Browse latest Browse all 3363

Javascript error help

$
0
0

I am not well versed in Javascript but I am trying to hide/show two different drop down (Choise) fields based on the value of another Choice field. Since I can't use Business Rule on a multi choice field I am stuck with Javascript.

Error message: Cannot read properties of null (reading 'setVisible')

My code

________________________________________________________________________________________________________

function HideFields(executionContext)
{
var formContext = executionContext.getFormContext();

var typeOfServiceProviderValue = formContext.getAttribute("vantage_typeofserviceprovider").getValue();

if (typeOfServiceProviderValue == 218700000)
{
formContext.getControl("vantage_typeofsupportiveservicesneeded").setVisible(true);
}
else
{
formContext.getControl("vantage_typeofsupportiveservicesneeded").setVisible(false);
}

var businesstype = formContext.getAttribute("businesstypecode").getValue();

if (businesstype == 809600001) //Service Provider
{
formContext.getControl("vantage_CountiesServed").setVisible(true);
}
else
{
formContext.getControl("vantage_CountiesServed").setVisible(false);
}

}


Viewing all articles
Browse latest Browse all 3363

Trending Articles



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