Hi,
Given below code set optionset value is working but when i remove value from field set value was not cleared.
please suggest me.
function setOptionSet()
{
debugger;
var relation="";
var relation=Xrm.Page.getAttribute("customertypecode").getOptions();
if (relation != null)
{
Xrm.Page.getAttribute("ownershipcode").setValue("1");
}
//var relation = null;
else if(relation==null && relation==undefined)
{
Xrm.Page.getAttribute("ownershipcode").setValue(null);
}
}
Thanks,
Naresh.
function hide(){
var fax = null;var fax =Xrm.Page.getAttribute("fax").getValue();if(fax != null && fax != undefined){Xrm.Page.getControl("telephone1").setVisible(false);Xrm.Page.getControl("parentaccountid").setDisabled(true);}else if(fax==null){
Xrm.Page.getControl("telephone1").setVisible(true);Xrm.Page.getControl("parentaccountid").setDisabled(false);}}function set(){
//var name == null;var name= Xrm.Page.getAttribute("name").getValue();if(name != null){Xrm.Page.getAttribute("fax").setValue("WWW.Abbaap.com");//var name == null;hide();}else if(name==null){Xrm.Page.getAttribute("fax").setValue(null);}}function setOptionSet(){debugger; var relation="";var relation=Xrm.Page.getAttribute("customertypecode").getOptions();if (relation != null){Xrm.Page.getAttribute("ownershipcode").setValue("1");}//var relation = null;else if(relation==null && relation==undefined){Xrm.Page.getAttribute("ownershipcode").setValue(null);}
}