Hello.
So this is my code:
function new_hideFields(executionContext)
{
var formContext = executionContext.getFormContext();
if (formContext.getControl('header_process_amp_appointmentlink') != null)
formContext.getControl('header_process_amp_appointmentlink').setVisible(false);
if (formContext.getControl('header_process_amp_emaillink') != null)
formContext.getControl('header_process_amp_emaillink').setVisible(false);
if (formContext.getControl('header_process_amp_phonecalllink') != null)
formContext.getControl('header_process_amp_phonecalllink').setVisible(false);
var introduction = formContext.getAttribute('amp_introductiontype').getText();
if(introduction != null)
{
if(introduction == "Appointment")
{
formContext.getControl('amp_appointmentlink').setVisible(true);
}
else if (introduction == "Email")
{
formContext.getControl('amp_emaillink').setVisible(true);
}
else if (introduction == "Phone Call")
{
formContext.getControl('amp_phonecalllink').setVisible(true);
}
}
}
When I make any changes and refresh the page, I get the error that "Cannot read property 'SetVisible' of null.
What is the error that I am making here?