AUTO GENERATION Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/category/auto-generation/ Microsoft Dynamics CRM . Microsoft Power Platform Fri, 14 Feb 2014 08:19:00 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.1 https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/cropped-Microsoftdynamics365-blogs.png?fit=32%2C32 AUTO GENERATION Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/category/auto-generation/ 32 32 176351444 AUTO GENERATE END DATE USING JAVASCRIPT IN MSCRM 2011 , 2013 http://microsoftdynamics.in/2014/02/14/auto-generate-end-date-using-javascript-in-mscrm-2011-2013/ Fri, 14 Feb 2014 08:19:00 +0000 http://microsoftdynamics.in/2014/02/14/auto-generate-end-date-using-javascript-in-mscrm-2011-2013/ //Automatic generation of end date function EndDateGeneration() {     var NewDate = new Date(Xrm.Page.getAttribute( “new_startdate”).getValue());     if (NewDate.getMonth() < 3) {         DateYear = NewDate.getYear();     }     else if (NewDate.getMonth() > 2) {         DateYear = NewDate.getYear() + 1;     }     if (DateYear % 4 == 0 && DateYear % 100 != 0) {         var Enddate = new Date(NewDate.setDate(NewDate.getDate() + 365));     }     else if (DateYear % 4 == 0 &&...

The post AUTO GENERATE END DATE USING JAVASCRIPT IN MSCRM 2011 , 2013 appeared first on Microsoft Dynamics 365 Blog.

]]>
//Automatic generation of end date

function EndDateGeneration() {
    var NewDate = new Date(Xrm.Page.getAttribute( “new_startdate”).getValue());
    if (NewDate.getMonth() < 3) {
        DateYear = NewDate.getYear();
    }
    else if (NewDate.getMonth() > 2) {
        DateYear = NewDate.getYear() + 1;
    }
    if (DateYear % 4 == 0 && DateYear % 100 != 0) {
        var Enddate = new Date(NewDate.setDate(NewDate.getDate() + 365));
    }
    else if (DateYear % 4 == 0 && DateYear % 100 == 0 && DateYear % 400 != 0) {
        var Enddate = new Date(NewDate.setDate(NewDate.getDate() + 365))
    }
    else {
        var Enddate = new Date(NewDate.setDate(NewDate.getDate() + 364));
    }
    Xrm.Page.getAttribute( “new_enddate”).setValue(Enddate);
    Xrm.Page.getAttribute( “new_enddate”).setSubmitMode(“always” );
    Xrm.Page.ui.controls.get( “new_enddate”).setDisabled(true );
}


SOURCE : JUST2CODE.IN
Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post AUTO GENERATE END DATE USING JAVASCRIPT IN MSCRM 2011 , 2013 appeared first on Microsoft Dynamics 365 Blog.

]]>
2846