I am trying to write an if statement, that will check to see if remittancefile is selected as No in the option field. If so then I want it to set the values of the following fields. I am pretty sure I have the set values correct. I just cannot get the if statement working properly. I am not sure if it is actually the if statement or the get attribute I am using. Any help is greatly appriciated.
Code:
function NAIfNo( )
{
var Name = Xrm.Page.data.entity.attributes.get("new_deadlinetime");
//get the value of remittance file
var file = Xrm.Page.data.entity.attributes.get("new_remittancefile");
//check to see if remittance file equals “no”
//the optionset value data for no is 100000001
if (file == No)
{
//set values to following fields if remittance file is “no”
Xrm.Page.getAttribute("new_remittanceformat").setValue(999999999);
Xrm.Page.getAttribute("new_dpremittance").setValue(999999999);
Xrm.Page.getAttribute("new_deliveryremittance").setValue(999999999);
Xrm.Page.getAttribute("new_remittancepassword").setValue(999999999);
Xrm.Page.getAttribute("new_frequencyremittance").setValue(999999999);
Name.setValue("N/A");
Xrm.Page.getAttribute("new_paperstatement").setValue(999999999);
}
}
*This post is locked for comments