I have a script that is popping a message on load. If the field i'm checking has a value it works as it should but if the field is null i get an error. What can i add to the script to fix that error?
function checkAccountingStatus() { var accountingstatus = Xrm.Page.getAttribute('accountratingcode').getSelectedOption(); if (accountingstatus.value == 282740001) { Xrm.Utility.alertDialog("The Account is in Collections."); } }