I am trying to create a custom event field. As you probably know, the way to do that is to create a custom activity field since an event is a special type of activity.

I want to subtract an event's start time from the end time so I can determine its length.

However, when I build my formula, I cannot choose the event start/end fields. All I see are activity fields, not event fields.

What I am looking for:

  • EndDateTime
  • StartDateTime

Event fields

But when I build my formula, I cannot use these names. I get Error: Field EndDateTime does not exist. Check spelling.

I get this whether I try

  • EndDateTime - StartDateTime or
  • EndDateTime - ActivityDateTime

Formula building in Salesforce

So why cannot I use the event fields in my formula? What is their real field name? This is frustrating.

Thanks everyone.

BTW this relates to another question I asked here.

Lastly, I found the Salesforce field name reference and it does list the fields I want to use.

2 Answers 2


DurationinMinutes is a standard field which calculates time duration in minutes between StartDateTime and EndDateTime

You can create a formula field based on DurationinMinutes For e.g. DuratoininHours would be

(DurationInMinutes / 60)
  • Really? Thanks for that. Still it does not explain why I cannot get access to these fields... Feb 23, 2016 at 15:01
  • So conversely, given an eight-hour day, DurationInDays would be DurationInMinutes / 60 / 8 Feb 23, 2016 at 15:02
  • DurationInDays would be (DurationInMinutes / 1440) and DurationInBusinessDays would be (DurationInMinutes / 480)
    – Jarvis
    Feb 23, 2016 at 15:05
  • 1
    @DavidBrossard It entirely up to you and your business what should be the dividing factor.
    – Jarvis
    Feb 23, 2016 at 15:10
  • 1
    Thanks Bennie, I implemented your suggestion, divided by 24, made sure I exclude weekends and I got just what I wanted. Feb 23, 2016 at 15:13

The only issue while using this "DurationInMinutes" field is it's not support if we changed StartDateTime on event. If we change/update EndDateTime its calculates difference between these two dates. The reason is : whenever we change StartDateTime the EndDateTime updating Time value to maintain Duration between these two datefields.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .