I'm trying to convert the Start Date and End Date, that are part of the standard SFDC Activity object, into hours. It looks like it is not possible to access these two fields (schema names StartDateTime and EndDateTime), from a formula field.
I need to obtain the total number of hours between those to fields. The idea is to use this value to make further calculations that are possible from a formula.
Anyone could give me an idea on how to accomplish this? Thanks in advanced!
Attribution to: Carlos Naranjo
Possible Suggestion/Solution #1
Are you looking at the "Event" object (which is a more specific type of Activity)? If so, it actually uses ActivityDateTime as the start time (unless it is an All Day event) and then either DurationInMinutes or EndDateTime to signify the length.
https://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_event.htm
Attribution to: Michael Welburn
Possible Suggestion/Solution #2
Agree with @Michael, looks like you are talking about teh Event Object. If you want the number of hours you would go to
Setup -> Customize -> Activities -> Activity Custom Fields
Create a new formula field, of type number, and however many decimal places you want. The formula is below.
(DurationInMinutes / 60)
Just make sure you only add it to event layouts and not Task layouts
Attribution to: Chris Duncombe
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/34548