function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sri0378Sri0378 

Reg: Date & Time Values Adjust at Opportunity Custom Fields

I have 2 custom fields in the opportunity like Start date and End date
The format for them is Start Date:-  10/20/2010 10.59PM
                               End Date :-    11/31/2010   10:59 PM
The time will be set automatically whatever the time the shows.

 

Now, the requirement is that  Star Date : Any date  12:01AM and End date : Any Date 11:59 PM.

 

So the time should be displayed like that no matter what ever the created date and time and it is for every oppotunity.

 

Is it possible , please help me on this?

NBlasgenNBlasgen

Seems like such a strange request, IMO.  Not sure why you're not just putting in a date field if the hours are always going to be midnight on both ends (unless you really are looking to ignore the two minutes between 11:59PM and 12:01AM).

 

But in any case, I'll try to answer your question.  Only way that comes to mind for me would be to use a trigger.  You have a user facing date field called Start Date.  Then based on the date that the user selects, you have a trigger that loads that date in and adds 1 minute to it, then stores it in a Date / Time field (rather than just a Date field).  For the end date, the trigger would load in the date and then add another day and subtract one minute from it.  Then it would store that in another field that's DateTime.

 

Might be best if you explain the reason you need this setup since there might be other ways to meet the requirements that don't involve this.