Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 55831

Set optionset value

$
0
0

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);}
}


Viewing all articles
Browse latest Browse all 55831

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>