You need to sign in to do that
Don't have an account?

Event Start/Stop DateTime fields not showing up as editable ... shows up as output string
Code has worked in the past, and suddenly stopped. I have simplified it as much as possible ...
VF Page:
<apex:page standardController="Event">
<apex:form>
Start: <apex:inputField value="{!event.startdatetime}"/><br/>
End: <apex:inputField value="{!event.enddatetime}" /><br/>
<apex:commandButton value="Save" action="{!save}"/>
</apex:form>
</apex:page>
Please assist.
Vanya
Thanks for the information. Andres Perez also responded to a case I had entered which concurs with your statement. He was able to give me a work around that has fixed my problem (using ActivityDateTime and DurationInMinutes as you suggested). Hopefully it will be useful to others who are having the same problem.
<apex:page standardController="Event" extensions="aaPage24"> <apex:form > <apex:messages /> <apex:pageBlock mode="edit"> <apex:pageblockButtons > <apex:commandButton value="Save" action="{!MySave}" /> </apex:pageblockButtons> <apex:pageBlockSection columns="1"> <apex:inputField value="{!Event.Subject}" /> <apex:inputField value="{!Event.StartDateTime}" /> <apex:inputField value="{!Event.EndDateTime}" /> <apex:inputField value="{!Event.ActivityDate}" /> <apex:inputField value="{!Event.ActivityDateTime}" /> <apex:inputField value="{!Event.DurationInMinutes}" /> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page> Apex Extension: public class aaPage24 { Event e; ApexPages.StandardController c; public aaPage24(ApexPages.StandardController controller) { c = controller; e = (Event) c.getRecord(); } public PageReference MySave() { e.StartDateTime = e.ActivityDateTime; e.EndDateTime = e.ActivityDateTime.addMinutes(e.DurationInMinutes); c.Save(); return null; } }
Thanks everyone for all of your assistance.
Vanya
All Answers
Hey
I would first check the profiles field level permissions for you profile.
Wes
I suspect that this is a limitation of the current Visualforce representation, since I myself could not get the fields to work either. There appears to be no way under any circumstance to make inputField editable for these two fields. Worse, if you include them and also include a binding to DurationInMinutes or ActivityDateTime, the page becomes unsavable without an extension or custom controller to adjust StartDateTime and EndDateTime so that it coincides with ActivityDateTime and DurationInMinutes.
For example:
<apex:page standardController="Event"> <apex:form> <apex:inputField value="{!event.activitydatetime}"/><br/> <apex:inputField value="{!event.durationinminutes}"/><br/> Start Time: <apex:inputField value="{!event.startdatetime}"/><br/> End Time: <apex:inputField value="{!event.enddatetime}"/><br/> <apex:commandButton action="{!save}" value="Save"/> </apex:form> </apex:page>
Thanks for the information. Andres Perez also responded to a case I had entered which concurs with your statement. He was able to give me a work around that has fixed my problem (using ActivityDateTime and DurationInMinutes as you suggested). Hopefully it will be useful to others who are having the same problem.
<apex:page standardController="Event" extensions="aaPage24"> <apex:form > <apex:messages /> <apex:pageBlock mode="edit"> <apex:pageblockButtons > <apex:commandButton value="Save" action="{!MySave}" /> </apex:pageblockButtons> <apex:pageBlockSection columns="1"> <apex:inputField value="{!Event.Subject}" /> <apex:inputField value="{!Event.StartDateTime}" /> <apex:inputField value="{!Event.EndDateTime}" /> <apex:inputField value="{!Event.ActivityDate}" /> <apex:inputField value="{!Event.ActivityDateTime}" /> <apex:inputField value="{!Event.DurationInMinutes}" /> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page> Apex Extension: public class aaPage24 { Event e; ApexPages.StandardController c; public aaPage24(ApexPages.StandardController controller) { c = controller; e = (Event) c.getRecord(); } public PageReference MySave() { e.StartDateTime = e.ActivityDateTime; e.EndDateTime = e.ActivityDateTime.addMinutes(e.DurationInMinutes); c.Save(); return null; } }
Thanks everyone for all of your assistance.
Vanya
Unfortunately this solution does not work for new events. The fields don't show up, I have to use inputText or another workaround :-(