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

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 82002

Latest Images

Trending Articles



Latest Images