Problems with Calendar list and custom forms
Posted by CJ on May 30, 2008
Recent problems I have come across when designing custom forms for the Calendar list. This work couldn’t be completed using Visual Studio (project requirements).
Hmmm….its these little things that take time when working sharepoint….ok sometimes it is also the big ones
Problem 1
Create a list from the Calendar template.
- Create your own custom forms (NewForm.aspx. EditForm.aspx or DispForm.aspx) in SharePoint designer (I didn’t remove the existing web part I just hid it).
- Now go and add new item using your new forms and then edit the item you have just entered.
- Select the make all day event check box and wham…you receive the lovely error occurred error message. Apparently this is a reported bug.
Problem 2
Same scenario as described above. Custom forms in a calendar list.
- Now add a third date column and make it a date only.
- Add a new item and fill in all dates and select the All Day Event check box and save the record
- Now edit same the item and you will see that the third date column has automatically decreased its value by one day. Continue to save and edit and that third date column will decrease its value by one day every time you save the record back to the list.
Problem 3
So with all these issues I went to a custom list. But my problems didn’t end there. Date only columns default to a time of 12:00am. This means that if you select a start date and an end date and display it as a monthly calendar view then the item displays up to the end date at 12:00am, so it displays one day short. If you add 5 minutes to the time and make it 12:05am then it displays for the whole day and looks correct.
Update: Work around
- Changed Date columns to Date and Time columns and defaulted to Today date. This defaults the time component to the current time which is required so it shows up correctly in the Calender view (not one day short).
- This then inserted the time component in the NewForm.aspx and EditForm.aspx so I hid the time component using CSS. Style: ms-…{block:none}
Problem 4
Same scenario as described above. Custom forms for a custom list.
- Dates display correctly to the regional settings that are set except for dates on the DispForm.aspx. It always displays in US format even though SharePoint’s regional settings is set to something else.
Update: work around
- Open the Dispform.aspx in SPD and change the xsl for the DateTime field and set the date format to 5 (instead of 1). This will now only show the date component
Also when creating your own custom forms using SharePoint designer you should never remove the existing List Form Web Part on the .aspx, just make them hidden.
http://support.microsoft.com/kb/935504
Would love to hear other peoples workarounds in the above situations.
Oliver Fisk said
Would be really interested in finding a solution for problem 1.
At this stage it seems calendar forms are totaly uncustomisable. Huge bug.
CJ said
Hi Oliver
Totally agree. Seems to be many issues customising Calendar list forms.
CJ
wolfezw said
how to hid the time component using CSS. Style: ms-…{block:none} or javascript ,could you please give more details? thanks for your help.
cj said
Wolfezw
I didn’t realise it cut off the css class name…sorry. I am not sure off the top of my head what class name the time component of the DateTime field is called. What I did was use IE Developer toolbar to find the css class name of the component and then in the custom forms (.aspx pages) I applied .ms-[class name]: {block:none} which will hide the time component.
Maybe you could post the css class name here when you find out what it is…that would be greatly appreciated.
CJ
wolfezw said
thanks you so much, I will try to find out the class name.
wolfezw
CS said
Hello,
I’ve been working on a custom list for a calendar and I created a custom dispform.aspx page. Basically a new aspx page that I dropped in the data form webpart on to display fields that I want and hide those that I don’t end users to see. The parameters are setup for querystring(ID) and all works well until I hit a recurring event. If I click on the recurring event…the new dispform page I created defaults to the first event on the list. Have you seen this? I’ve been trying to figure out why I can’t display the details of a recurring event with a data form web part. Using the List Form web part…it’s fine but I can’t show/hide the fields that I want. Any suggestions? Thank you.
CS
APN said
I have created a new display page for a calendar list using the data view web part. It does not work right with recurring events. If I click on a recurring event, the event details being displayed are the details of the first created event on the list. If the event is a single event, it displays details just fine.
Did somebody find a solution to this issue?
Andy said
I have the same problem as CS and APN with recurring meetings. I think sharepoint must be storing each occurance in a hidden list somewhere as there doenst appear to be any details about the recurrence in your row apart from the @recurrence=1 field.
APN said
I actually found a fix for that problem.
Open the .aspx page, where you have your DataFormWebPart, using SharePoint Designer. Then select the WebPartPages: DataFormWebPart in Design mode and click on the emerging arrow to the right to display the Common Data View Tasks menu. In the Common Data View Tasks menu, click on Parameters. You should be able to see two Parameters: ListItemID and ListID. Select the List ID parameter, and remove it from the list. Click OK to save your changes.
Your Series Items details should work properly now.