Quantcast
Channel: Microsoft Dynamics CRM
Viewing all articles
Browse latest Browse all 154803

Forum Post: CRM and JavaScript error when trying to see if date field contains data

$
0
0
I have the following script, but when I select a date in the SlideDeckDueDate Field I get and error that says, "Object doesn't support property or method 'getText' at SlideDeckDueDateOnChange." I just want to check to see if this field contains data, and if so, then make other fields required. What am I doing wrong? function SlideDeckDueDateOnChange() { var SlideDeckDueDate = Xrm.Page.getAttribute("nhs_slidedeckduedate").getText(); if (SlideDeckDueDate == null || SlideDeckDueDate =='undefined' || SlideDeckDueDate =='') { Xrm.Page.getAttribute("nhs_currenttimeframe").setRequiredLevel("none"); Xrm.Page.getAttribute("nhs_previoustimeframe").setRequiredLevel("none"); } else if (SlideDeckDueDate != null && SlideDeckDueDate != 'undefined' && SlideDeckDueDate !='') { Xrm.Page.getAttribute("nhs_currenttimeframe").setRequiredLevel("required"); Xrm.Page.getAttribute("nhs_previoustimeframe").setRequiredLevel("required"); } }

Viewing all articles
Browse latest Browse all 154803

Trending Articles



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