Post

7 followers Follow
3
Avatar

Custom duration field units

I created a custom field of type Duration and set it based on a formula, using the DateSubtract function.  This is working great, except that the units displayed for my custom field is always hours.  I need it to be weeks, or at least days.  Is it possible to set the units of the custom field?

Farhan Virji Answered

Please sign in to leave a comment.

12 comments

0
Avatar

Farhan, 

Just to get a better understanding of what you are trying to do, can you provide your Use Case? What are you trying to accomplish with this Custom Field?

Boris Krutiy 0 votes
Comment actions Permalink
0
Avatar

Hi Boris,

The standard Duration field is set based on the Project Start Date and Project Due Date.  I want to create a duration field based on a different date in our project because from our perspective, there are a few internal tasks that we do before we officially start a project with a customer.  I want to still track the time it takes for the overall project (including our internal tasks) as Duration, but I also want to track the time it takes to complete the project once we start with the Customer.   

The custom duration field is working as expected, except that it's always showing hours instead of days or weeks.

Farhan Virji 0 votes
Comment actions Permalink
-1
Avatar

Farhan, 

I think this would be an excellent opportunity to discuss a Best Practice solution to meet your needs with your Customer Success Manager (Patrick Smith). 

I will send Patrick an email and ask for him to reach out to you.

 

Sincerely,

Boris Krutiy -1 votes
Comment actions Permalink
0
Avatar

Hi Boris,

I haven't heard from my CSM (Patrick Smith).  Can you ping him again as I want to come up with a solution for this.

 

Thanks,

Farhan

Farhan Virji 0 votes
Comment actions Permalink
0
Avatar

Yes I will. I believe he was on vacation last week. I will send him a message and ask him to contact you when he returns from vacation.

Boris Krutiy 0 votes
Comment actions Permalink
0
Avatar

I have the same challenge - I would like to convert the "hours" returned by the datesubtract function to "days".   Any luck figuring out how to do this?

Ann Kurtz 0 votes
Comment actions Permalink
-1
Avatar

Hi Ann,

The only way I know of right now is  to simply divide by 8. A working day is normally 8h or 7.5h so you would divide it by that number.

Tom Do -1 votes
Comment actions Permalink
0
Avatar

I am also encountering this issue. I tried to use "Days" to convert the hours to days however I get an error message when checking the syntax. 

 

Field Type: Duration

Days(DateSubtract($C_GoLiveDate, $C_MasterContractSignedDate,TRUE))

 

Error: Argument 'number' to function Days() must be of Numeric type

Monica Brucks 0 votes
Comment actions Permalink
0
Avatar

Was there ever a fix to have a custom field with the type of duration to return duration in days instead of hours?

Kristin Rohrer 0 votes
Comment actions Permalink
0
Avatar

It's a bit of a hack, but I have got round it with this: Days(((DateSubtract(Today(),$StartDate,TRUE)) / Hours(1))/7.5)

I have hard-coded the 7.5 to represent our default hours/day, this then gives me my duration in days.

Note that this formula gives me the number of working days which have passed since the start of the task.

Jeremy Tiley 0 votes
Comment actions Permalink
0
Avatar

I've tried this solution:

Days(((DateSubtract(Today(),$CreatedOn,TRUE)) / Hours(1))/7.5)

But have this error:

Error: Invalid function Today() usage in current context

The field type is duration

I'm trying to create a field that will log how long a case was open for, in days, and doesn't include weekends or days that we have set in the org calendar as non working, such as bank holidays.

Thanks for any help.

Martin Jubb 0 votes
Comment actions Permalink
0
Avatar

I have 2 custom fields of duration type, both set with near identical formulas but one appears in months the other in hours can you perhaps look into these inconsistencies or give admins the ability to set the units?

Nyssa Woods 0 votes
Comment actions Permalink