Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to create a Activity event(Sobject) vf page without the duration and time field. Because these fields are required one i don't need these on my can we do it without these fields. If so can anyone provide me with some sample.

share|improve this question
Unclear question, what do you want to achieve? Do you want the VF page to set some default values for your two required fields upon sobject creation? Do you want to replace the standard view-layout of an object with a VF page that hides certain fields? – Martin Peters Jan 2 '13 at 16:25
i created a vf page with some custom field in it from Event object but i didnt place DurationInMinutes and ActivityDateTime fields in this page because i dont need these field to my requirement when im trying to save the record im getting error msg REQUIRED_FIELD_MISSING, Required fields are missing: [Duration]: [Duration] – rakesh Jan 2 '13 at 16:33
up vote 4 down vote accepted

A Salesforce Event happens at a particular time and date, and has a duration in minutes. If you set the Start Datetime and Duration, the End Datetime will be filled in, and if you set Start and End, Duration will be filled in. However, you can't create an Event without specifying this information in some way. If you don't want to display it on the page, you could write a custom controller extension that sets these values "behind the scenes".

However, I don't understand why you would create an Event that doesn't happen at a particular time, so it may be that I'm missing something.

share|improve this answer
i created a date custom field and for time i created a picklist. I'm placing these custom field on vf page. so i dont need those Standard fields as u said can you plz provied me the sample with controller extension to set values behind – rakesh Jan 2 '13 at 17:35
I see, you need to convert between the custom field and the standard datetime field. I suggest you give it a try writing a controller extension based on the Event standard controller. If you have trouble with the extension, post your code here with a new question and we'll help as we can. – Jeremy Nottingham Jan 2 '13 at 17:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.