Send Birthday Email to Contacts

Send Birthday Email to Contacts : Generally will get the requirement from client to send Birthday emails to their customers. Everyone will suggest going with Console Application schedule to run at the specific time. But is there a way to do it using OOB features?. Yes, we can achieve this through OOB features simply by … Continue reading Send Birthday Email to Contacts

Difference in days between two dates

 Difference in days between two dates : Here, we are stamping the diffrence in days between two dates i.e first date and second date. function days() { debugger; if (Xrm.Page.getAttribute("gb_firstdate").getValue() != null && Xrm.Page.getAttribute("gb_seconddate").getValue() != null ) { debugger; var days; var firstdate = Xrm.Page.getAttribute("gb_firstdate").getValue(); var seconddate = Xrm.Page.getAttribute("gb_seconddate").getValue(); if (firstdate > seconddate) days = … Continue reading Difference in days between two dates

Difference in Dates format DD MM YY

Difference in Dates : Recently, we have a requirement to show the difference between two dates in the following format DD MM YY. Here is the code to populate the difference data. function differencedates() { debugger; if (Xrm.Page.getAttribute("gb_firstdate").getValue() != null && Xrm.Page.getAttribute("gb_seconddate").getValue() != null) { debugger; var days; var firstdate = Xrm.Page.getAttribute("gb_firstdate").getValue(); var secondate = Xrm.Page.getAttribute("gb_seconddate").getValue(); if … Continue reading Difference in Dates format DD MM YY

Insert Logs to internal storage

Insert Logs to internal storage : Add a class file.cs extension to the solution. Paste the below code. using System; using System.IO; //Creating Logger Class public class Logger { //Creating method name as "Write" with input parameter public void Write(string Message) { try { DirectoryInfo directoryInfo; string str; string FileWrite; FileWrite = "Y"; str = … Continue reading Insert Logs to internal storage

Restrict Future Date

Restrict Future Date : Here, validating the date of birth. Generally, Date of Birth should not be a future date. It should always Past date. Here is the validation to allow only past dates. function futuredatevalidation() { if (Xrm.Page.getAttribute("gb_birthdate")  != null) { var birthdate = Xrm.Page.getAttribute("gb_birthdate").getValue(); if ( birthdate != null) { birthdate.setHours(0, 0, 0, … Continue reading Restrict Future Date