Day 3
Day 3
try {
var formContext = executionContext.getFormContext();
var formType = formContext.ui.getFormType();
formContext.getAttribute("new_loancustomercity").setValue("Bangalore");
}
if (formType == 2) { // Editable form
formContext.getAttribute("new_loancustomercity").setValue("Kadapa");
}
}
catch (e) {
Xrm.Utility.alertDialog(e.message);
}
}
try {
var formContext = executionContext.getFormContext();
var customerType = formContext.getAttribute("new_customertype").getValue();
//how do get optionset label or text
var customerTypeLabel =
formContext.getAttribute("new_customertype").getText();
//alert(customerTypeLabel);
}
catch (e) {
Xrm.Utility.alertDialog(e.message);
}
}
if(customerType =="Individual")
{
//How do you set optionset
formContext.getAttribute("axis_loantype").setValue(1);
}
if (customerType == "Corporate") {
formContext.getAttribute("axis_loantype").setValue(2);
}
}
catch (e) {
Xrm.Utility.alertDialog(e.message);
}
}