Hi All,
I have created a web resource and used that web resource in a field which is used two times in the same form of an entity. I have to use the same functionality on both the fields. It is working fine with one field but not working with another which is used later below the form. I have used the controls also as below:
Please assist.
var PhoneNoAttribute = Xrm.Page.getAttribute("new_telephonenumber");
var PhoneNoControls = PhoneNoAttribute.controls.get();
for(var i=0; i < PhoneNoControls.length; i++)
{
PhoneNoControls[i].setDisabled(false);
var telephone= Xrm.Page.data.entity.attributes.get("new_providedphonenumber").getValue();
if (telephone == 100000002)
{
Xrm.Page.ui.controls.get("new_telephonenumber").setVisible(true);
Xrm.Page.data.entity.attributes.get("new_telephonenumber").setRequiredLevel("required");
}
else
{
Xrm.Page.ui.controls.get("new_telephonenumber").setVisible(false);
Xrm.Page.data.entity.attributes.get("new_telephonenumber").setRequiredLevel("none");
}
}
}
*This post is locked for comments