Hello, I am having an issue with my below script and wondering if someone can help me out. I tried F12, but that isn't giving me an error.
function RecordTypeOnChange()
{
var RecordType = Xrm.Page.getAttribute("nhs_recordtype").getText();
var RequestType = Xrm.Page.getAttribute("nhs_requesttype").getText();
if (RecordType == null || RecordType =='undefined' || RecordType =='')
{
}
else if (RecordType != null && RecordType != 'undefined' && RecordType !='')
{
if (RecordType == "Medicare")
{
Xrm.Page.getControl("RequestType").removeOption(127130000);
Xrm.Page.getControl("RequestType").removeOption(127130001);
Xrm.Page.getControl("RequestType").removeOption(127130003);
Xrm.Page.getControl("nhs_idcardbooktype").setVisible(false);
}
else if (RecordType == "Commercial")
{
//Xrm.Page.getControl("RequestType").clearOptions();
Xrm.Page.getControl("RequestType").addOption({value: 127130000, text: 'Football'});
Xrm.Page.getControl("RequestType").addOption({value: 127130001, text: 'NFL'});
Xrm.Page.getControl("RequestType").addOption({value: 127130002, text: 'NHL'});
Xrm.Page.getControl("RequestType").addOption({value: 127130003, text: 'NBA'});
Xrm.Page.getControl("RequestType").addOption({value: 127130004, text: 'TBD'});
}
}
}
/**************************************************************
Function to call on Load
**************************************************************/
function RecordTypeOnLoad()
{
RecordTypeOnChange();
}
*This post is locked for comments