Skip to main content

I’ve got a button on the opp detail page that uses row actions to create a new event and displays it in a popup.  Similar to the standard SFDC functionality, I’m looking to set the default start date/time to the beginning of the next hour and the end date/time to the start date/time + 60 mins.

For example, if I create the event as 1/30/2015 @ 12:13pm, the start date/time should default to 1/30/2015 @ 1:00pm and the end date/time should default to 1/30/2015 @ 2:00pm.

Any ideas?

This cannot be done declaratively.   The best you can do is create a default value in the create new row action using the date literal “TODAY”  which will put current time into the field.  To get more specific time manipulation you’d need to create a custom renderer on the fields in the popup that populated them with data you calculated in javascript. 


How about updating the row with calculated times. 

newEventModel.updateRow(eventRow, fields)

Times could be calculated as described in javascript.

Set the row action to create a new row in it’s own model.

Set an snippet action on the row when new rows are created. 


This is one of those things that would make me a hero…but I don’t know enough (read: any) javascript to make it happen.  Is it … maybe … floating around somewhere that I could borrow it?  :P


I’d like to just set default times of 9 to 5 but keep the day the user clicked on the calendar