View all resources on a SharePoint group calendar by default.

I have set up a group calendar in SharePoint and added 10 items to the associated Resources list.  By default resource bookings will not appear on the group calendar unless you manually select the resources through the interface.  I would like the calendar's default view to display all bookings (or all available resources) by default.  Anyone have recommendations on the best way to do this?

Eric

October 20th, 2010 6:23pm

I'm looking for the same answer. I'm trying to create a reservation calendar, but the resources keep disappearing.
  • Proposed as answer by kweidi Thursday, February 28, 2013 2:46 PM
Free Windows Admin Tool Kit Click here and download it now
October 31st, 2010 11:45am

Has anyone solved the problem?
December 14th, 2010 9:34am

Hi Eric,

 

  Have you by any chance solved your problem?  I've been looking at this as well and haven't found a solution yet. Thought that I might find a few clues in the sharepoint designer but nothing so far...

  Note that if you look at the "All Events" view, you can see all of the events for all of the resources.

  I'm getting a bit worried. Looks like every time you want to see if a resource is booked, you have to add it to the calendar :-P

Free Windows Admin Tool Kit Click here and download it now
December 14th, 2010 3:38pm

A simple trick *that does not solve the problem completely* is to group all your resources in a group and add the group instead. Of course, there is still manual work involved every time you refresh the page.
Upon inspecting SPD source (advanced mode) and the page in IE, it seems there is a server control involved and it uses javascript to add users and/or resources. See
<%@ Register Tagprefix="ApplicationPages" Namespace="Microsoft.SharePoint.ApplicationPages.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
on top of the page and
<ApplicationPages:CalendarAggregationPanel id="AggregationPanel" runat="server"/>
at the bottom. Also, note the evtid=add_resource in page source. SO, it doesn't look easy to fix using light tools.
AK
December 14th, 2010 5:51pm

please give an example.
Free Windows Admin Tool Kit Click here and download it now
December 14th, 2010 6:45pm

Nicely spotted - so theoretically, we could code some javascript to set some variables and then raise the event.  I'm going to look into this a bit more and see what I can come up with. Thanks, AK!
December 15th, 2010 6:55am

anyone find a solution for this? I am trying to create a reservations calendar and need them all to show up by default...
Free Windows Admin Tool Kit Click here and download it now
February 7th, 2011 7:21pm

No, I trained my users to add a resource group to see the reservations calendar
February 7th, 2011 7:44pm

... that may not work for my users.  

Alternatively i could just add all 1000+ users to the sharepoint group and add them all as attendees but that is extremely messy and would be hard to keep up to date.

Free Windows Admin Tool Kit Click here and download it now
February 7th, 2011 8:44pm

I am also very disappointed from the lack of this functionality
February 7th, 2011 8:53pm

Can MICROSOFT please give a solution to this ot at least a work around?
Free Windows Admin Tool Kit Click here and download it now
March 18th, 2011 4:41am

You can find an answer on my blog here:

http://zepeda-mcmillan.blogspot.com/2011/03/displaying-default-resources-on-group.html

It's not the prettiest solution, but it should give you a workaround for now. Hopefully MS will add some additional functionality to the group calendar in a future release.

 

Thomas

March 29th, 2011 10:56pm

Hi Thomas,

Your solution looks like a winner, however I couldn't quite get it to work.

Following the steps in your blog I copied your javascript and replaced the var xml with my version of the ecma encoded string.  Is there anything else I need to tweak for your javascript to work on my calendar?

I'm only using a single calendar on the page.

 

Eric
Free Windows Admin Tool Kit Click here and download it now
March 30th, 2011 12:15am

i need a solution too, tried out thomas zepeda-mcmillans solution but didn´t work for me :(

i have to build a car reserveration solution, car1, car2, car3 etc....

when i save the javascript as .txt file and upload it into a document library, add the link into the content editor webpart i get nothing...

- add the content editor webpart above the group calendar? i did this
- i also created a resource group as he describes...

plz help,

thx

March 30th, 2011 10:52am

I forgot to mention that I'm using JQuery 1.5.x... which is why you see the $() variables. I would suggest uploading JQuery to the same document library or Style Library, and then referencing it using the <script src="/Style Library/jquery-1.5.1.min.js" type="text/javascript"></script> tag. Sorry I forgot to mention that in my post. I will update it shortly.
Free Windows Admin Tool Kit Click here and download it now
March 30th, 2011 4:52pm

thx, this brings me 1 step further, but no ressource will be displayed... i´m not a developer... :)

i only changed the ressource group to mine and the ressources to my ressources, what do i have to change else? sry for my noob questions :(

I have 3 resources in 1 resource group.

i post my code in here (the code with jquery reference is above this code):

function _setDefaultResources() {
    var el = $(".ms-acal-rootdiv");
    var xml = "\u003cEntities Append=\u0022True\u0022 Error=\u0022\u0022 DoEncodeErrorMessage=\u0022True\u0022 Separator=\u0022;\u0022 

MaxHeight=\u00223\u0022\u003e\u003cEntity Key=\u0022Autos\u0022 DisplayText=\u0022autos\u0022 IsResolved=\u0022True\u0022 Description=

\u0022\u0022\u003e\u003cExtraData\u003e\u003cArrayOfDictionaryEntry xmlns:xsi=\u0022http:\u002f\u002fwww.w3.org\u002f2001\u002fXMLSchema-

instance\u0022 xmlns:xsd=\u0022http:\u002f\u002fwww.w3.org\u002f2001\u002fXMLSchema\u0022\u003e\u003cDictionaryEntry\u003e\u003cKey xsi:type=

\u0022xsd:string\u0022\u003eResourceMembers\u003c\u002fKey\u003e\u003cValue xsi:type=\u0022xsd:string\u0022\u003e1;#Auto 1;#2;#Auto 2\u003c

\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003cDictionaryEntry\u003e\u003cKey xsi:type=\u0022xsd:string\u0022\u003eSPResourceId\u003c

\u002fKey\u003e\u003cValue xsi:type=\u0022xsd:string\u0022\u003e30\u003c\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003cDictionaryEntry

\u003e\u003cKey xsi:type=\u0022xsd:string\u0022\u003ePrincipalType\u003c\u002fKey\u003e\u003cValue xsi:type=\u0022xsd:string

\u0022\u003eResourceGroup\u003c\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003c\u002fArrayOfDictionaryEntry\u003e\u003c\u002fExtraData

\u003e\u003cMultipleMatches \u002f\u003e\u003c\u002fEntity\u003e\u003c\u002fEntities\u003e";


    var sel = SP.UI.ApplicationPages.CalendarSelector.instance().getSelector(1, $(el).attr('ctxid'));
    sel.selectEntities(xml, true);
}
 


ExecuteOrDelayUntilScriptLoaded(_setDefaultResources, "sp.ribbon.js");
March 31st, 2011 6:24am

Hmmm... looking at your xml, it seems to be formatted correctly. Here is the output of the long xml string:

 

<Entities Append="True" Error="" DoEncodeErrorMessage="True" Separator=";" MaxHeight="3">  <Entity Key="Autos" DisplayText="autos" IsResolved="True" Description="">    <ExtraData>      <ArrayOfDictionaryEntry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">        <DictionaryEntry>          <Key xsi:type="xsd:string">ResourceMembers</Key>          <Value xsi:type="xsd:string">1;#Auto 1;#2;#Auto 2</Value>        </DictionaryEntry>        <DictionaryEntry>          <Key xsi:type="xsd:string">            SPResourceId          </Key>          <Value xsi:type="xsd:string">30</Value>        </DictionaryEntry>        <DictionaryEntry>          <Key xsi:type="xsd:string">PrincipalType</Key>          <Value xsi:type="xsd:string">ResourceGroup</Value>        </DictionaryEntry>      </ArrayOfDictionaryEntry>    </ExtraData>    <MultipleMatches />  </Entity></Entities>

 

I only see 2 Autos in your resource group however... but the 2 should display properly.

Try this:

1. View source on your page and search for the "Title" of your web part, e.g. "Group Calendar"

2. Locate the id tag nearest to your title... it should be something like WebPartTitleWPQ3

3. Use this version of the script to test it:

function _setDefaultResources() {
  var xml = "\u003cEntities Append=\u0022True\u0022 Error=\u0022\u0022 DoEncodeErrorMessage=\u0022True\u0022 Separator=\u0022;\u0022 

MaxHeight=\u00223\u0022\u003e\u003cEntity Key=\u0022Autos\u0022 DisplayText=\u0022autos\u0022 IsResolved=\u0022True\u0022 Description=

\u0022\u0022\u003e\u003cExtraData\u003e\u003cArrayOfDictionaryEntry xmlns:xsi=\u0022http:\u002f\u002fwww.w3.org\u002f2001\u002fXMLSchema-

instance\u0022 xmlns:xsd=\u0022http:\u002f\u002fwww.w3.org\u002f2001\u002fXMLSchema\u0022\u003e\u003cDictionaryEntry\u003e\u003cKey xsi:type=

\u0022xsd:string\u0022\u003eResourceMembers\u003c\u002fKey\u003e\u003cValue xsi:type=\u0022xsd:string\u0022\u003e1;#Auto 1;#2;#Auto 2\u003c

\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003cDictionaryEntry\u003e\u003cKey xsi:type=\u0022xsd:string\u0022\u003eSPResourceId\u003c

\u002fKey\u003e\u003cValue xsi:type=\u0022xsd:string\u0022\u003e30\u003c\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003cDictionaryEntry

\u003e\u003cKey xsi:type=\u0022xsd:string\u0022\u003ePrincipalType\u003c\u002fKey\u003e\u003cValue xsi:type=\u0022xsd:string

\u0022\u003eResourceGroup\u003c\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003c\u002fArrayOfDictionaryEntry\u003e\u003c\u002fExtraData

\u003e\u003cMultipleMatches \u002f\u003e\u003c\u002fEntity\u003e\u003c\u002fEntities\u003e";


  var sel = SP.UI.ApplicationPages.CalendarSelector.instance().getSelector(1, '[Context ID]');
  sel.selectEntities(xml, true);
}
 
ExecuteOrDelayUntilScriptLoaded(_setDefaultResources, "sp.ribbon.js");

The [Context ID] should be WPQ[number] which last bit of the ID you found in step 2.

Let me know if this helps

 

Free Windows Admin Tool Kit Click here and download it now
March 31st, 2011 10:31pm

hi, i forgot the </script> end-tag... but didn´t help anyway. Now the group calendar webpart displays the standard - my reservations, i can add ressources and it loses them when the page is refreshed... :(

i found out the wpq number by viewing the page with the IE developer toolbar, the group calendar webpart gets framed when i search for MSOZoneCell_WebPartWPQ, so i think the number (2) is correct :)

thx for your help :) :)

 i post my complete code:

<script src="http://sharepoint.gv.oebb.at/sites/Poolautoreservierung/Reservierung/Freigegebene Dokumente/jquery-1.5.1.min.js">

function _setDefaultResources() {    
    var xml = "\u003cEntities Append=\u0022True\u0022 Error=\u0022\u0022 DoEncodeErrorMessage=\u0022True\u0022 Separator=\u0022;\u0022 

MaxHeight=\u00223\u0022\u003e\u003cEntity Key=\u0022Autos\u0022 DisplayText=\u0022autos\u0022 IsResolved=\u0022True\u0022 Description=

\u0022\u0022\u003e\u003cExtraData\u003e\u003cArrayOfDictionaryEntry xmlns:xsi=\u0022http:\u002f\u002fwww.w3.org\u002f2001\u002fXMLSchema-

instance\u0022 xmlns:xsd=\u0022http:\u002f\u002fwww.w3.org\u002f2001\u002fXMLSchema\u0022\u003e\u003cDictionaryEntry\u003e\u003cKey xsi:type=

\u0022xsd:string\u0022\u003eResourceMembers\u003c\u002fKey\u003e\u003cValue xsi:type=\u0022xsd:string\u0022\u003e1;#Auto 1;#2;#Auto 2;#3;#Auto 3\u003c

\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003cDictionaryEntry\u003e\u003cKey xsi:type=\u0022xsd:string\u0022\u003eSPResourceId\u003c

\u002fKey\u003e\u003cValue xsi:type=\u0022xsd:string\u0022\u003e30\u003c\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003cDictionaryEntry

\u003e\u003cKey xsi:type=\u0022xsd:string\u0022\u003ePrincipalType\u003c\u002fKey\u003e\u003cValue xsi:type=\u0022xsd:string

\u0022\u003eResourceGroup\u003c\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003c\u002fArrayOfDictionaryEntry\u003e\u003c\u002fExtraData

\u003e\u003cMultipleMatches \u002f\u003e\u003c\u002fEntity\u003e\u003c\u002fEntities\u003e";




    var sel = SP.UI.ApplicationPages.CalendarSelector.instance().getSelector(1, '[2]');

    sel.selectEntities(xml, true);
}
ExecuteOrDelayUntilScriptLoaded(_setDefaultResources, "sp.ribbon.js");
</script>
April 1st, 2011 7:55am

Change the [2] to WPQ2... that should fix the issue.
Free Windows Admin Tool Kit Click here and download it now
April 2nd, 2011 8:35pm

hi, i think the ID of the Webpart ist "WebpartWPQ2" ?

i testet both, but nothing happens :( i don´t know why, if i delete the </script> tag, the calendar webpart doesn´t work correctly, so i think the javascript affects the group calendar webpart... but i only see my standard user reservations :(

i use sharepoint 2010 enterprise english with german language pack, could this cause the problem?

thx in advice! :)

April 4th, 2011 6:26am

First things first Florian, you can't have a scr="" in your javascript <script > tag.

 

Try this script instead, and make sure you enter it exactly as it is entered below:

 

<script type="text/javascript" src="http://sharepoint.gv.oebb.at/sites/Poolautoreservierung/Reservierung/Freigegebene Dokumente/jquery-1.5.1.min.js" ></script>
<script type="text/javascript"> function _setDefaultResources() { var xml = "\u003cEntities Append=\u0022True\u0022 Error=\u0022\u0022 DoEncodeErrorMessage=\u0022True\u0022 Separator=\u0022;\u0022 MaxHeight=\u00223\u0022\u003e\u003cEntity Key=\u0022Autos\u0022 DisplayText=\u0022autos\u0022 IsResolved=\u0022True\u0022 Description= \u0022\u0022\u003e\u003cExtraData\u003e\u003cArrayOfDictionaryEntry xmlns:xsi=\u0022http:\u002f\u002fwww.w3.org\u002f2001\u002fXMLSchema- instance\u0022 xmlns:xsd=\u0022http:\u002f\u002fwww.w3.org\u002f2001\u002fXMLSchema\u0022\u003e\u003cDictionaryEntry\u003e\u003cKey xsi:type= \u0022xsd:string\u0022\u003eResourceMembers\u003c\u002fKey\u003e\u003cValue xsi:type=\u0022xsd:string\u0022\u003e1;#Auto 1;#2;#Auto 2;#3;#Auto 3\u003c \u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003cDictionaryEntry\u003e\u003cKey xsi:type=\u0022xsd:string\u0022\u003eSPResourceId\u003c \u002fKey\u003e\u003cValue xsi:type=\u0022xsd:string\u0022\u003e30\u003c\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003cDictionaryEntry \u003e\u003cKey xsi:type=\u0022xsd:string\u0022\u003ePrincipalType\u003c\u002fKey\u003e\u003cValue xsi:type=\u0022xsd:string \u0022\u003eResourceGroup\u003c\u002fValue\u003e\u003c\u002fDictionaryEntry\u003e\u003c\u002fArrayOfDictionaryEntry\u003e\u003c\u002fExtraData \u003e\u003cMultipleMatches \u002f\u003e\u003c\u002fEntity\u003e\u003c\u002fEntities\u003e"; var sel = SP.UI.ApplicationPages.CalendarSelector.instance().getSelector(1, 'WPQ2'); sel.selectEntities(xml, true); } ExecuteOrDelayUntilScriptLoaded(_setDefaultResources, "sp.ribbon.js"); </script>

Free Windows Admin Tool Kit Click here and download it now
April 4th, 2011 10:40pm

i copied your code 1:1 , still not displaying any ressources, i made a screenshot, maybe there´s a problem with the other calendar on the top site?

the code ist in "test.txt" file....

thx for your time, greetings

Uploaded with ImageShack.us

 

April 5th, 2011 6:24am

Are you running IE 9? Have you tried F12 to run the developer tools, and then running debug on the scripts tab? If you are running IE 9: http://msdn.microsoft.com/en-us/ie/ff468705#_Dev_Tools

 

You want to click the Script tab and click the "Start Debugging" option at the top. This should refresh the page, and output any errors that Javascript may be generating. Send me a screenshot of the output... you can find my email on my blog if you wish to email me directly.

If you aren't running IE 9, you should at least download the IE 8 developer tools here:http://msdn.microsoft.com/en-us/library/dd565628%28v=vs.85%29.aspx

 

Free Windows Admin Tool Kit Click here and download it now
April 5th, 2011 6:10pm

Hi, yes i am running IE9, i get the error "SEC7115: :visited and :link styles can only differ by color. Some styles were not applied to :visited."

greetings :)

 

April 6th, 2011 5:26am

Hmm... that error isn't very helpful :-P

Can you just click "View Source" on you page, and send it to me via email? tom.mcmillan@gmail.com

 

Thomas

Free Windows Admin Tool Kit Click here and download it now
April 7th, 2011 3:06am

hi,sent you an email :)
April 11th, 2011 8:30am

Hi!

I have the same problem!

Please ASAP give an answer to this!

TKs

Free Windows Admin Tool Kit Click here and download it now
April 13th, 2011 2:00pm

Hi Thomas and Florian,

I've been following your threads.  Have you gotten the script to work on Florian's SharePoint site?

Eric

April 15th, 2011 3:44pm

Hi, folks,

 

Thank you very much for useful tips.

When I use this code, I see added resources and current user account. How can I delete current user account?

Free Windows Admin Tool Kit Click here and download it now
April 19th, 2011 2:53pm

My solution was to add a CEWP above the calendar with the following code:  (note that you will have to have jquery available and provide the proper path)

<script src="/SiteAssets/Javascript/jquery-1.5.2.min.js" type="text/javascript"></script>
<script type="text/javascript">

 $(document).ready(function() {
  $('a.clickable').click(function(event){
   event.preventDefault();
   $('input.ms-input').val($(this).html());
   $("img[alt='Check Names']").click();
  });
 });</script>
<style>
TD.personlink {padding-left:10px;padding-right:10px;}
</style>
<Table><tr>
<td class="personlink"><a class="clickable" href="#">Group1</a></td>
<td class="personlink"><a class="clickable" href="#">Gruop2</a></td>
<td class="personlink"><a class="clickable" href="#">Group3</a></td>
</tr>
</table>
This code provides links that the user can click on to populate the view with.  I believe it can be configured to execute on a page load or refresh, but I'll let someone else come up with that.
April 20th, 2011 5:21pm

Why when I go into Designer does the preview show me all the events?  Then I go on my page and I only get the user events.  I can not believe we will be forced to use Jquery as a solution to this.  I just want to see everyones reservations lol, why is this so hard: (
  • Proposed as answer by Hartmann2306 Friday, April 29, 2011 3:46 PM
  • Unproposed as answer by Hartmann2306 Friday, April 29, 2011 3:47 PM
Free Windows Admin Tool Kit Click here and download it now
April 27th, 2011 6:53pm

Here is how I managed to get around the issue with the resource reservation calendar:

1. Create a new Group Calendar. In the More Options select "Use this calendar for resource reservations"

2. Once the calendar is created, go into the Calendar list settings. Click Title Description and Navigation. Set "Use this calendar for resource reservation" to no.

3. While in the calendar list settings, Click Change new button order and default content type. Check "Reservations" and set it to the default content type.

When you go back to the calendar it will just have the normal calendar ribbon without the buggy resource selection options. When you add a new list item, the calendar will be associated to the resource list and let you select the resources and detect their availability.

  • Proposed as answer by Chewbears Friday, April 29, 2011 6:48 PM
  • Marked as answer by SD Eric Friday, April 29, 2011 6:55 PM
April 29th, 2011 4:00pm

Hartmann that did it for me!

 

Thanks!

Free Windows Admin Tool Kit Click here and download it now
April 29th, 2011 6:48pm

Works for me too.  Thanks Hartmann.

April 29th, 2011 6:57pm

That worked for me too!!

 

Thanks a lot, Hartmann2306! :)

Free Windows Admin Tool Kit Click here and download it now
May 3rd, 2011 11:38am

Stupid tricks, but MANY thanks!

It was such an headache!


-------------------------------

By the way, remember to change the default Calendar View to Monthly or Weekly View

Otherwise the Week Group View may crash.....

May 6th, 2011 10:26am

Nice

 

Very, very nice.

 

Many thanks!

Free Windows Admin Tool Kit Click here and download it now
October 21st, 2011 7:40am

Thank you Hartmann. It worked like a wonder!
December 8th, 2011 9:35pm

Any way to do this with People instead of Resources?
Free Windows Admin Tool Kit Click here and download it now
June 18th, 2012 4:32pm

This worked great, however i am having problems trying to get the montly calendar to be defaulted with the resources on it when the calendar displayes initially.  I need to select the resources, it goes back to the week view, then I need to click monthly again and it displays with resources.  how can it get it show with resources initially.

July 2nd, 2012 1:42pm

Great
Free Windows Admin Tool Kit Click here and download it now
July 3rd, 2012 8:37am

I know that this is an old post but while Hartmann2306's answer works there are two caveats with it.

1) I had to set the Calender view to explicitly show the Resources content type or the monthly view would still show empty

2) I found that doing the above steps removes the ability to check double booking on your resource. Not a show stopper but just an FYI.

EDIT!

I need to clarify that this seems to be due to the Calendar already having had items scheduled. I made the changes on a calendar that had three Reservations set up. Hartmann2306's solution works perfectly on an empty, brand new calendar. If there are events/reservations already scheduled you might run into issues.

  • Edited by IsiaMaria Wednesday, September 05, 2012 4:04 PM Clarification
September 5th, 2012 3:57pm

Hi IsiaMaria,

i still wouldn't able to make it to be working. Would you mind list more detail related to Hartmann2306's answer.

Thanks

Free Windows Admin Tool Kit Click here and download it now
October 8th, 2012 5:52am

Here is how I managed to get around the issue with the resource reservation calendar:

1. Create a new Group Calendar. In the More Options select "Use this calendar for resource reservations"

2. Once the calendar is created, go into the Calendar list settings. Click Title Description and Navigation. Set "Use this calendar for resource reservation" to no.

3. While in the calendar list settings, Click Change new button order and default content type. Check "Reservations" and set it to the default content type.

When you go back to the calendar it will just have the normal calendar ribbon without the buggy resource selection options. When you add a new list item, the calendar will be associated to the resource list and let you select the resources and detect their availability.


If you want to be able to add attendees you need to use the "Schedule and Reservations" content type.
February 28th, 2013 6:54pm

Not helpful for SP 2013 on premise
Free Windows Admin Tool Kit Click here and download it now
March 21st, 2015 5:53pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics