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

javascripts for using in ms crm 365

$
0
0

Hello everyone ,

i need one small help in java scripts.

i have written below code in field called actual start-(this is field) in form in ms crm 365.

my requirement is ....when i open a page then actual start date should be auto field and if someone want to change date in less then current date then it should through alert message and make the field blank (actual start) while saving the form and does not let the save the form unless entered the current date or future date ...

----------------------------------------------------------------

function fromDateValidation()
{
debugger;
var fromDate = Xrm.Page.getAttribute("actualstart").getValue();
var today = new Date();
var currentDate = today.setHours(0, 0, 0, 0);
Xrm.Page.getAttribute("actualstart").setValue(currentDate);
// var currentDate = today.getDate();
// var getFromDate = new Date(fromDate);
//var frDate = getFromDate.getDate();

if(fromDate < currentDate) {
alert("Start Time cannot less than Today's date");
Xrm.Page.getAttribute("actualstart").setValue(null);
return false;
}
}

-----------------------------------------------------------

m sorry to ask this but m new to this java scripts

thanks .

AMit 


Viewing all articles
Browse latest Browse all 79901

Trending Articles



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