Wednesday, May 7, 2014

Adding an Auto-Refresh Content Editor Web Part

Adding an Auto-Refresh Content Editor Web Part


Requirement :

You want to create a dashboard which will automatically refresh itself on a regular basis

The Solution

This is easily accomplishable using a SharePoint Web Part and little bit of scripting, JavaScript in this case, to be precise.

How to Accomplish This Task

Start by going to the page you want to edit, and begin editing the page (you Should have at least designer rights to do this).


Add a Web Part to your page (you should already be in a mode like below).




Choose the “Media and Content” Category, “Content Editor” Web Part, and add it to any part of the page (such as the “Header”).















Select the web part and choose “Edit Web Part” from the drop down. A menu will appear on the top right hand side of the page, you may need to scroll over/up to find it












 Set the Title to “Refresh the Web Page”.







Set the Chrome Type to “None”.





Click OK to accept those changes. Then you need to add the script to the web page. To do this, you start by clicking in the section “Click here to add new content”.




A cursor will appear in the content area, however, don’t type anything in the content area, instead simply go to the ribbon and under Editing Tools -> Format Text, select the HTML drop down, and choose “Edit HTML Source”.


 





In the HTML Source box, enter the following JavaScript code.



this script is calling a function after 5 minutes (1000 milliseconds * 60 seconds * 5 minutes = 300000 – this can be any value you choose, just do the math right), which will refresh the page (without showing the annoying, “Are you sure you want to resubmit this page” message that appears in IE when using “window.location.reload”).
Finally, stop editing the page and you will be all done.








Your page should now have a hidden Web Part which will refresh the page every 5 minutes (or whatever number you should choose).

Tuesday, June 4, 2013

This view cannot be displayed because the number of lookup and workflow status columns it contains exceeds the threshold enforced by the administrator?

If you've ever migrated site collections from one farm to another, or upgraded from a 2007 farm to a 2010 farm, you may encounter this error the following error:
"This view cannot be displayed because the number of lookup and workflow status columns it contains exceeds the threshold (8) enforced by the administrator."



This is caused by Resource Throttling that was introduced in SharePoint 2010.  The settings can easily be adjusted to cater to your specific environment and are set for each web application.  To adjust the limits, follow these steps:
  • Open Central Administration
  • Click "Application Management" in the left navigation menu.
  • Click "Manage Web Applications" on the Application Management page.
  • A list of all your web applications in the target farm will be displayed.  Select the target web application by clicking the white space between the Title and the URL.
  • The Ribbon should now light up.  Click on "General Settings".  Do NOT click the gears icon above General Settings as it will take you to the General Settings page instead of the Resource Throttling page.
  • A dropdown menu will activate.  On this menu, click "Resource Throttling".








  • On the Resource Throttling page, scroll down to the List View Lookup Threshold section.  By default, this value is set to 8.
  • Change the value to the desired number.
  • Scroll down and click "OK".


Now when you navigate back to the list view in question, provided the lookups is less than the number you just set, the view should render normally.