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
vasvas 

Problem with Start date and End date on Event page

I have a visualforce page based on standard Event controller. The fields StartDateTime and EndDateTime do not render correctly. I'm using inputField for them in a pageBlockSection, and they are rendered as non-editable text fields. No calendar widget or time field etc. Is this a problem in Visualforce? Any solution to this?

 

The same problem described in this message as well, but no solution.

 

http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=3503

 

 

Thanks

aalbertaalbert

Try setting the ActivityDateTime and DurationInMinutes.

 

Here is a simple snippet that was able to create the Event:

<apex:page standardController="Event"> <apex:form > <apex:inputField value="{!event.subject}"/> <apex:inputField value="{!event.activityDateTime}" id="testId"/> <apex:inputField value="{!event.durationInMinutes}" />

<apex:commandButton action="{!save}" value="Save"/> </apex:form> </apex:page>

 

vasvas

ActivityDateTime is really not StartDateTime, is it? And, what do I use for EndDateTime? Thanks for helping.

aalbertaalbert

http://www.salesforce.com/us/developer/docs/api/index_Left.htm#StartTopic=Content/sforce_api_objects_event.htm

 

I specified ActivityStartDate and DurationInMinutes within my Apex code and it properly set both StartDateTime and EndDateTime accordingly. 

 

Have you tried the code snippet provided? 

vasvas

Ah.. the combination of those 2 fields! Well, not exactly what I was looking for but could be an acceptable workaround. I was trying to mimic exactly the way the Start and End fields are dispayed on standard Event edit page. I contacted the salesforce support and they accepted this as a bug. I think I can live with your solution till they fix it.

 

Thanks a lot for the help.