This blog will demonstrate how to set a default due date for the Phone Call entity in Dynamics CRM 4.0 by using a little bit of JavaScript.
T0 start go to Settings-->Customization-->Customize Entities. Scroll down to Phone Call and edit it by double-clicking or selecting More Actions and Edit from the toolbar.
Next, select Forms and Views and edit the Form. Select Form Properties and click the Edit button for the OnLoad Event. Copy the following code into the editor and click OK.
var CRM_FORM_TYPE_CREATE = "1";
var DUE;
var TODAY;
// Only make these changes when the form is opened in Create mode.
if (crmForm.FormType==CRM_FORM_TYPE_CREATE)
{
// Get today's date.
TODAY = new Date();
DUE = TODAY.setDate( TODAY.getDate());
crmForm.all.scheduledend.DataValue = DUE;
}
No comments:
Post a Comment