Sharepoint 2010 Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint 2010       RSS Feeds

Multi-Day events

  Date: May 29    Category: Sharepoint 2010    Views: 6107

My hopes for this are low, but I'm throwing this out there to see if anyone has
any ideas.

I'm creating a course catalog for our internal training classes. Some of the
courses span multiple non-contiguous days. Sometimes the pattern is easily
repeatable (every Wednesday), and sometimes it is not (Tuesday week 1, Friday
week 2).

In the easily repeatable category, it is simple enough to create a calendar list
and use the built-in "repeat" functionality. However, that does not work in the
second case because SP only has patterns to choose (you can't specify a specific
list of dates in the "repeat" section.)

Then I had an idea. I'd create a custom list, and include the Event Content
Type. I then created a sub Content Type "2-Day Event" and further extended that
into "3-Day Event" (None of the courses currently take longer than 3 full
working days). Now I had my list of items, but when I went to throw them into a
calendar view, I was only able to select 1 column each for start and end times.

My last resort is to create Event Day 1, Event Day 2, etc events in a calendar
list, but that becomes cumbersome for entry unless I can figure out a way to
make the input forms enter multiple list items.

And as an added hurdle, this is on SharePoint Foundation 2010. So, no Infopath
and no Document Sets.



7 Answers Found

Answer #1    Answered On: May 29    

Can you have a record entry be tagged as 1, 2, or 3 day event and then have the
workflow add the additional records to the list?

Answer #2    Answered On: May 29    

So I have the course catalog list (with my custom content types), and a
workflow to expand and add them to a separate calendar list. I like it.

Answer #3    Answered On: May 29    

So this is actually working quite well. Until I started to get fancy with it.

Here’s the problem now:
I’ve got my Course Catalog that auto-populates the Class Schedule on item
creation (or manually if you edit either the catalog or the schedule). I’m
sending over the times (for each entry if more than one) and the Title of the
class. What I’d like, however, is a reverse reference in the Class Schedule
that somehow gets back to the course in the catalog.

I’ve tried passing Current Item:Encoded Absolute URL in to the Description. I
get a link, but it’s garbage. (I also tried a couple of the other URLs
including the server relative URL, also with no success.) Then I thought I’d
create a column on my calendar that’s a Lookup to the catalog. In the column
definition, I selected ‘Title (linked to item)’ as the link. However, in
the workflow, when I try and assign ‘Current Item:Title (Link to item with
edit menu) (old)’ to the Lookup column, the workflow fails on the type
casting. I tried a couple of different Current Item fields, but they all failed
on cast.

This is all in SP Designer. I may have to bite the bullet and build the
workflow in VS.

Answer #4    Answered On: May 29    

Sometimes when trying to reference an item in a list that is different from
"Current Item" I have had issues. Also I have had issues with referencing with a
variable of type "List Item ID." So I have at times made a clone of the List ID
field with a type of Number. That way I can refer to it, store it in other
number fields, etc. It's rather clunky, especially if you are used to relational
DBs and being able to join table, convert data types etc. But it does work.

Answer #5    Answered On: May 29    

I never use a workflow to do list updates. The asych will mess you up every
time, and it's just limited in what it can do (as you've found). The only thing
I use workflows for now are "wait until" and "send an email."

Instead, I use SPServices, which is a jQuery library written by Marc Anderson
out on codeplex. It's not too difficult to get set up and incredibly powerful.
His doco is second to none and he's unbelievably responsive to questions.

SPServices wraps all of the web services in jQuery, which allows you to build up
exactly what you want stored in an item and cast it as you will. Overriding the
PreSaveAction() function that gets called on every OOB form submit, you can tell
SharePoint exactly what to do with your data.

For examples of what I'm talking about, I have a couple of articles on
NothingButSharePoint.com that dig into the PreSaveAction() and SPServices:

vwp-_e2_80_93-part-5-doing-stuff-before-save-on-submit-presaveaction.aspx and

In your case, once you've chosen your class dates, you would use SPServices to
write your dates to the calendar, along with a link back to your course. When
you click save on the course, SPServices updates the calendar.

Another benefit to this approach is that you could put data checking into your
course's EditForm to update the dates from the course if they change. IOW, you
can use SPServices to look up the course dates from your calendar list, then if
the course dates change, write back to the calendar the date changes.

Answer #6    Answered On: May 29    

Try the "Build Dynamic String" action. You can concatenate string
values. For example, type: http://webappname/ and then add a lookup for:
[%ListName:ServerRelativeURL%] which would give you the whole URL you
are looking for. (I don't remember if it's ServerRelativeURL or one of
the other ones...)

If you want to get fancy you can add a single line of text field to
your list (e.g. HostNameField), use Javascript to pipe in the
location.hostname value to that column in your list's *form.aspx pages,
and then hide the row - no need to confuse your users - using
Javascript. That way when you save the listitem your workflow can take
the columns and concatenate them together. Then your application can be
dynamic through your DEV environment all the way to PROD. You would
build the string like so:
http://[%ListName:HostNameField%]/[%ListName:ServerRelativeURL%] (
http://[%ListName:HostNameField%]/[%ListName:ServerRelativeURL%] )

Answer #7    Answered On: May 29    

Thank you for your suggestions. As it turns out, I didn't need to use them,
but it's good information to have going forward.

The moral of the story: make sure the lookup column is configured correctly. I
should have tried to do it manually much sooner because then I would have
noticed that the lookup was referring to itself rather than the other list.

Once I reconfigured the column, then the original workflow I'd made worked
just fine.

Didn't find what you were looking for? Find more on Multi-Day events Or get search suggestion and latest updates.