Is anyone facing the same issue that I'm facing? The function below used to work perfectly. The problem is, that when the company value is null, it sets the contact as null, but it is not hiding the field.
function contactVisibility(executionContext)
{
formContext = executionContext.getFormContext();
if (Xrm.Page.getAttribute("company").getValue() == null)
{
formContext.getAttribute("contact").setValue(null);
formContext.getControl("contact").setVisible(false);
}
else
{
formContext.getControl("dobbs_contact").setVisible(true);
}