Change default Call Duration Time and Due Time - Phone Call Entity RRS feed

  • Question

  • Hi,

    I have been asked to change the default Call Duration Time and Due Time on the Phone Call Entity.

    I have added an 'OnLoad' event to set the Call Duration...

    // Set the default duration to 5 minutes when the form is opened.
    var CRM_FORM_TYPE_CREATE = "1";
    var iMinutes = 5;

    if (crmForm.FormType==CRM_FORM_TYPE_CREATE)
       crmForm.all.scheduleddurationminutes.DataValue = iMinutes;

    The issue is that when I load the entity I get an error

    There was an error with the fields customized event



    Error:'crmForm.all.scheduleddurationminutes' is null or not an object

    Any help would be appreciated.


    Tuesday, July 6, 2010 1:31 PM


All replies

  • Are you sure you are not wanting to update actualdurationminutes (default Duraton field on phone call).
    MSCRM Bing'd - http://bingsoft.wordpress.com
    • Marked as answer by DavidHodgson Tuesday, July 6, 2010 2:12 PM
    Tuesday, July 6, 2010 1:34 PM
  • Actually I was not sure which duration field I was wanting to update :)

    I will give that one a try, do you know how I would set the Due Time, I thought by setting working hours for a user the Due Time would set to the first working hour of the day not Midnight 00:00?


    Tuesday, July 6, 2010 1:40 PM
  • Create a javascript Date object and set you date/time and then set it to the DataValue of the scheduledend (Due) field. If you specify only a date then the time will default to 00:00.
    MSCRM Bing'd - http://bingsoft.wordpress.com
    Tuesday, July 6, 2010 2:01 PM
  • Thanks,

    I managed to get the Duration working so I will have a go with the Date/Time


    Tuesday, July 6, 2010 2:13 PM
  • hi

    how did you get the duration working, I also found that code in your original post and tried modifiying it with actualdurationminutes but couldn't get it working, perhaps I'm entering the code in the wrong place.  First I made a web resource as javascript, made the resource available to the form, then put the resource as a function onload.  But the form errors on opening a new phone call.  I even tried just simplifying the code to one line: crmForm.all.actualdurationminutes.DataValue = 5; to no avail.  What am I missing?

    Monday, August 6, 2012 6:42 PM