Quick Tip: Hide Date Placeholder Values in Adxstudio Portals for Dynamics CRM

Quick Tip: Hide Date Placeholder Values in Adxstudio Portals for Dynamics CRM

Posted By
BDO

In version 7.0.0022 of Adxstudio Portals, we noticed that date fields on Entity Forms, and Web Form Steps which used forms, were showing values even when they were blank in Microsoft Dynamics CRM. On read-only forms, this made it appear that a value was set in Dynamics CRM when it wasn’t. On editable forms where the field was also editable, it sometimes caused the portal user to skip over filling in the field, thinking that it already had a value and the value was not actually submitted to CRM when the user completed the form.

To resolve this issue we decided to hide the placeholder values by adding JavaScript to the Custom JavaScript field on the appropriate Entity Form or Web Form Step. Below is an example of the code we added to the Custom JavaScript field to hide the placeholder value.

Custom JavaScript Code to Hide Placeholder Values

$(document).ready(function ()

{

//call this function for each date field for which you want to hide the place holder

HideDatePlaceHolder(‘datefieldnamefromCRM’);

});


function HideDatePlaceHolder(fieldName)
{
var control = $(‘#’ + fieldName)[0];
if(control.value == "")
{

control.nextSibling.firstChild.placeholder = "";
}

}
 

Learned something new? Click here for more Quick Tips, or contact a Microsoft Dynamics CRM representative for further information.


Are you using a mobile CRM? Find out six strategic objectives a mobile CRM can help you achieve,
Are you using a mobile CRM? Find out six strategic objectives a mobile CRM can help you achieve,

 

BDO eBook - The Cloud Changes the Game

There are times in the course of your business when you have the opportunity to dramatically accelerate growth and improve day-to-day efficiencies. Recognizing

Download