718 Washington Ave. N. Suite #101
Minneapolis, MN 55401
View map and all Locations

Send us a message

If you spend a lot of time creating activities in Microsoft Dynamics CRM and would like a simple way to auto-populate a date field, here’s how:


First, decide what field you’d like to populate.  In this example, we focus on the due date field of the phone call entity.  Second, determine when you would like the field to populate.  Will it only be when creating new entities, modifying existing ones or both?  In this case, we’ll set the due date field on the creation of the phone call entity only.

The following JavaScript function is added as a web resource and then the function will be called on the OnLoad event of the form.

Above, you’ll notice that our whole function is wrapped in an if statement that is comparing the FormType.  This is how we determine if the form is for a new entity or the modification of an existing one.  On the next line, you’ll notice us getting a reference to our due date field (in this case, its schema name is scheduledend).  Later, we’ll use this to set the date we create.

The next two lines are where we create a Date (now) that matches the current date and time and then create a new date that exists exactly seven days in the future.

Finally, we assign our end date to the due date field we referenced earlier.  There you have it, a simple and quick way to remove a tedious task and effected standardization in your process.

Happy CRM’ing!

Avatar for JoeCRM


Joe CRM is a CRM superhero who runs on pure Microsoft Dynamics CRM adrenaline. As the face of PowerObjects, Joe CRM’s mission is to reveal innovative ways to use Dynamics CRM and bring the application to more businesses and organizations around the world.