You need to sign in to do that
Don't have an account?
pierrefrazny.ax358
Set default value for StartDateTime for an Event
Hi,
I would like to set a default value for the Start Time and End Time when the user clicks New Event. I created a custom button with the following URL but the syntax I am used in the past for setting default values does not seem to work for this particular field (Start Time is not populated as expected).
Here is the URL:
/00U/e&retURL=%2F{!Assignment__c.Id}&cancelURL=%2F{!Assignment__c.Id}&what_id={!Assignment__c.Id}&&StartDateTime_time="8:00 AM"&EndDateTime_time="4:00 PM"
I would appreciate any clues.
Thanks
Pierre
Intersting. From what I can tell, you have to set BOTH the date and time field in order to set the time field. For example,
The Date has to be in mm/dd/yyyy format. Don't know if you need the date in the future or today, but you can use a formula to construct the date. From my testing if you use an incorrect date format, you'll get an error "invalid date format" but the time will update.
All Answers
Noticed that you have a double ampersand in your string (bolded and underlined below). For URL, an amerspand "&" is a special character to indicate a parameter/variable and value pair. Fix the ampersand and see if that works.
/00U/e&retURL=%2F{!Assignment__c.Id}&cancelURL=%2F
{!Assignment__c.Id}&what_id={!Assignment__c.Id}&&StartDateTime_time="8:00 AM"&EndDateTime_time="4:00 PM"
I tried your siggestion and it did not work.
/00U/e?&retURL=%2F{!Assignment__c.Id}&cancelURL=%2F{!Assignment__c.Id}&StartDateTime_time="8:00 AM"&EndDateTime_time="4:00 PM"
Any other idea?
Intersting. From what I can tell, you have to set BOTH the date and time field in order to set the time field. For example,
The Date has to be in mm/dd/yyyy format. Don't know if you need the date in the future or today, but you can use a formula to construct the date. From my testing if you use an incorrect date format, you'll get an error "invalid date format" but the time will update.
It worked indeed. Thank you for your help.
Pierre
I am unable to assign default value for StartDateTime. I am unable to recognize specific format used for time in context of current login user.
For user's having different local have different time format.Some examples are as below:
2:00 AM
2.00 AM
2:00AM
2.00AM
2.00 PDT
Can any body help me how to identify dynamically the time format and based on that it will automatically adjust the time with format.
Hard coding for StartDateTime_time is not working due to different locale for different users.
For user 's having match the time format 2:00 AM will work but for users having diffent time format than it will not work...
like 2:00AM or 2.0AM or 2.0 PDT or 2:00 PDT
You can use the formula: {!TODAY()} to populate the start and end date as today's value. apex whistler is correct about there needing to be values in both StartDateTime, and StartDateTime_time for it to take the time value. Hope this helps someone.