Default Task Values Using the OnLoad Event

The default duration and due date are annoying in CRM, Sonoma Partners has provided some basic code to set the default duration to blank and the due to date to the current date and time stamp. This is opposed to the following image where the due date is blank and the duration is 30 minutes.

var CRM_FORM_TYPE_CREATE = 1;
var CRM_FORM_TYPE_UPDATE = 2;

switch (crmForm.FormType)
{
case CRM_FORM_TYPE_CREATE:
crmForm.all.actualdurationminutes.DataValue = null;
crmForm.all.scheduledend.DataValue = new Date();
break;

case CRM_FORM_TYPE_UPDATE:
// do nothing
break;
}

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>