0

I am working on a visualforce page with custom pop & other requirements. But I am not able to include the Follow up time field.

Now I am able to include remainderset checkbox. But how to add the reminder time field in vf page. enter image description here

Instead field "Follow-up Time" instead of reminder time next to the follow-up date to enter time in 15 mins intervals from 8:00 AM to 7:00 PM.

If any have idea please help me on this issue.

Thanks Inadvacnce, P.balu

1 Answer 1

0

You will need use html select / dropdown with custom LOV for you 15 mins interval . you can do this though javascript or apex .

You will then need to create a custom function that would parse your time value in apex for further processing.

Visualforce Page : -

      Visualforce.remoting.Manager.invokeAction(
                '{!$RemoteAction.<<yourController>>.getAvailableDatetime}',
                StartDateTime,ownerId,CurrentBranchCode,
                function(result, event) {
                    if(result != null && result.length > 0){
                        $('#StartTime').html($.map(result, function (val, key) {
                        return '<option value="' + val.Value + '">' + val.Lable + '</option>';
                        }).join(''));

                    }

     <div  id="timeSelection">
       <select id="StartTime"><option></option></select>                                                     
     </div>

APEX

     @RemoteAction
    public static list<AvailableSlots> getAvailableDatetime(){  
        list<timeSlots> result = new List<timeSlots>();
        result.add(new timeSlots('08:00-08:15 AM','08:00-08:15');
        result.add(new timeSlots('08:15-08:30 AM','08:15-08:30');
        result.add(new timeSlots('08:30-08:45 AM','08:30-08:45');
        result.add(new timeSlots('08:15-09:00 AM','08:15-09:00');
        result.add(new timeSlots('05:15-05:30 PM','17:00-17:30');

        return result;
    }       


    public class timeSlots{
        public boolean IsActive { get; set;}
        public String Value  { get; set;}
        public string Lable { get; set;}


        public timeSlots(string Value,String Label){
            this.Value = Value;
            this.IsActive = True;
            this.Lable = Label;
            }
    }

and you can then use something like below to finally convert user selected value to apex datetime

    hourVal = Integer.ValueOF(item.value.SubstringBefore('-').SubstringBefore(':'));
    minVal = Integer.ValueOF(item.value.SubstringBefore('-').SubstringAfter(':'));
    reultTime = DateTime.newInstanceGmt(yearVal, monthVal, dayVal, hourVal, minVal, 0);

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .