2

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.

1

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... – David Brossard Feb 23 '16 at 15:01
  • So conversely, given an eight-hour day, DurationInDays would be DurationInMinutes / 60 / 8 – David Brossard Feb 23 '16 at 15:02
  • DurationInDays would be (DurationInMinutes / 1440) and DurationInBusinessDays would be (DurationInMinutes / 480) – Jarvis Feb 23 '16 at 15:05
  • 1
    @DavidBrossard It entirely up to you and your business what should be the dividing factor. – Jarvis Feb 23 '16 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. – David Brossard Feb 23 '16 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.