1

SalesForce does not have a Time field type for sObjects which is a real pain. I am working on a scheduling app where users and facilities specify daily blocks of time when they are available (open). So, for example: Mondays 8:00am to 12:00pm.

My first thought was a text field with specific format (hours:mins:AM/PM or 24 hour). The problem with this is that if the field is text you cannot sort on it numerically, or have formula or roll-up fields based on it. Which I need.

So now I am thinking I will need two fields, hours and minutes, for each time field. Does anyone have any clever tricks or ideas on this topic? Or do you think two fields is the way to go?

I know SF is working on a time field for a future release but that doesn't help me now :)

closed as off-topic by Sebastian Kessel, Santanu Boral, Eric, Brian Mansfield, Mohith Shrivastava May 2 '17 at 1:56

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on problems in code you've written must describe the specific problem and include valid code to reproduce it. For help writing short, self-contained syntactically-valid examples, see: SSCCE.org" – Sebastian Kessel, Santanu Boral, Brian Mansfield
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    For a booking app I went the picklist route and then had a formula field that converted the picklist values to an overall time offset for the underlying logic. – Keith C May 1 '17 at 15:10
  • To use a picklist you need a static scheduling block (like we schedule appointments every 15 minutes). We let our users specify what their scheduling block is so I can't use a picklist type. I had been using text and using a list to select on a Visual Force page. I think using separate hour and minute fields and then using a formula field to create the formatted text might work. – SalesForce Jedi May 1 '17 at 15:18

Browse other questions tagged or ask your own question.