Wednesday, November 12, 2014

Set Default Content Type

I am writing this because I couldn't find the way to set the default content type through the browser. If you know, please comment below.

The reason for doing this is to have your content type come up when the user selects new item. If you didn't do this, the user has to click the down arrow on the new item in the ribbon, and then select your content type. (Sometimes, this is just too much to ask a user to know how to do and why "Promoted Links" is so popular.)

It is actually quit ease with SharePoint Designer. You only need to navigate to your list, select the content type, then select 'Set as Default' from the ribbon.



Monday, November 10, 2014

Issue Uploading a Large Number of Large Files to SharePoint

If you have ever been asked to upload a large number of large files (like videos) to SharePoint and found yourself cringing at the thought from past experiences then this post is for you! It seems like this should be a no brainer in SharePoint, but it's not.

I have tried uploading large files with open with explorer, but it basically hangs your windows explorer and leaves you wondering if it is ever going to complete. Sometimes it seems like pot luck if it does.

The next option is to leverage 'Sync'. I have done it this way in the past. It works, but it only worked for me if I dropped 5 large files at a time. Any more and it just didn't want to work robustly. I also had to clear my cache as I went along. Plus, what happens if you already have gigabytes of data in the library. Do you really want a copy of that locally?!

The answer, for me, was simply to use the "Upload" option.

For each large file that you want to upload, just open up a new page for that document library and select your file. It doesn't show you the progress, but you can easily navigate to another page and start the next upload or continue browsing without any noticeable overhead. For me, it "seemed" faster and more reliable than "Open with Explorer" and 'Sync'. These two options are great for the right scenario, but when comes to large files, 'Upload' seems the way to go. Hope this helps.

Happy uploading!


Wednesday, October 22, 2014

Clearing Your OneDrive Cache

For those of you that use OneDrive extensively, you may find that your disk drive is quickly running out of space. This is because OneDrive caches files on your Office temporary folder. These can get very large because it creates a cache file that is just a copy of the file it is trying to sync. I'm not sure what will trigger the cache files to clear out, so I created this batch script to clean out the files when I want. Just save this to a .bat file and run it.

Note: the %temp% directory, at this time, is something like "c:\users\xxxUSERxxx\AppData\Local\Microsoft\Office\15.0\OfficeFileCache"

cd %temp%
cd ..
cd microsoft
cd office
cd 15.0
cd OfficeFileCache
forfiles /m *.fsd  /d -1 /c "cmd /c del @file : date >= 1 days >NUL"
forfiles /m *.fsf  /d -1 /c "cmd /c del @file : date >= 1 days >NUL"


This script tries to avoid any currently opened files by starting with yesterdays  files (and older.) Technically you could just delete everything with *.* and windows will just ignore all the files that are open because OneDrive is trying to sync them at the moment and has them locked. What I'm trying to avoid with my approach is to avoid deleting the  "" files that OneDrive is using to manage the file syncing.

On a related note, When you run a repair on OneDrive it creates  *.Oldx versions of your OfficeFileCache folder in the %temp%\microsoft\office\15.0 directory with folder names like OfficeFileCache.old1, OfficeFileCache.Old2. These are copies of the folders before the repair executes. These can be deleted - if you are comfortable with the files you have on your OneDrive locally and in the cloud.



Wednesday, August 13, 2014

Share / User Access Requests and Invitations Missing

In Office 365/ SharePoint Online I came across and issue where I would share a site with an external user, but the invitation would not appear in the "Access requests and invitations" of the site setting. This did not prevent the invitation from being sent or the users accessing the site, but it made it difficult to track the invitations.

As it turns out, this is a know problem, but the cause was unknown. If you have this problem, then Microsoft has a script they can run to fix the issue. You will need to contact them to run the script in their hosted environment.

After going through a number of scenarios, I determined the root of this issue. If you create a site template from a site you created, you can create new sites from that template and the invitations work properly. If you create a new template from a site that was created from a template, the Access request and Invitations will not display your invitations. You will need to call Microsoft for a fix.

To avoid the problem, always make your changes on your original clean site and make new templates from your model template.


Thursday, August 7, 2014

No Code Hide Recent from Quick Menu

This isn't new, other's have posted this solution, but I think it's so elegant that I just want to spread the word. There are many JavaScript solutions, but personally, I would rather have a no code solution. It's simple so I'm not going to post any images. There are others that have created step-by-step blogs that are much more detailed, so keep looking down the google search results list if you need more info. :)

1. Create a new SharePoint group called Nobody.

2. Remove yourself from the group. (you are automatically added when you create the group.)

3. Under Site Settings, Navigation, under  "Structural Navigation: Editing and Sorting", select 'Recent' and click edit.

4. In the Audience field, add "Nobody".

5. Make sure to kick 'OK' for the page or your changes won't be saved.



Wednesday, August 6, 2014

SharePoint 2013 Enterprise Search Go Back - Revisited

This is a rehash of my previous post on the same subject, but it's been redone to use images.

So you want to leverage SharePoint Enterprise Search because it has all the bells and whistles you are looking for in your results and search features. You set your site to leverage enterprise search and you let people start using it. The problem that comes up is that when a user begins using the search, they are taken to the Enterprise Search site collection and there is no quick way to get back from where they started. The only way, out the box, is to hit the back button until they are back to where they started.

I found this to be less than ideal, so I cobbled together some JavaScript that leverages a browser session cookie to capture the site they launch the search. When the user is ready to go back, they simply click on the back button to return to where they started.

Here is the javascript:

<script type="text/javascript">
function returnGoBackURL() {
//*******************Specify your url search site here (with https and ending forward slash)*********
var rootURL = '';
var lastURL = document.referrer;
if (lastURL.substr(0,rootURL.length) != rootURL) {
setCookie('lastURL', document.referrer, 1 );
document.getElementById('returnURL').href = document.referrer;
} else {
document.getElementById('returnURL').href = getCookie('lastURL');

function setCookie(c_name,value,exdays){
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value + ";path=/";
function getCookie(c_name) {
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++)
 if (x==c_name)
return unescape(y);
<a href=""><img border="0" src="/sites/searchFAST/SiteCollectionImages/home2.png" alt="home"></a>
<a id='returnURL' class='returnURL' href=''><img border="0" src="/sites/searchFAST/SiteCollectionImages/back.gif" alt="back"></a>

Here are the a couple of starter images for Home and Back. Just update the image references in the script to point to the location of these files after you have put them on your site.

Add the script to a file and put it in the site collection documents. You will need to add a content editor web part (CEWP) to each of the search result pages and point it to the file you saved with the above script.  I put the CEWP under Search Navigation.

In O365, the search site has a document library called 'Pages'. In here are a number of result pages used to display the search results. The default is 'results', but you will find others for 'peopleresults', 'videoresults' and some others. You will want add the content editor webpart to all the result pages where you want the back button to appear.


Wednesday, June 18, 2014

Workflow Fails to Publish - Copy Workflow Actions Issue

This is a post is actually regarding using the copy and paste function in SharePoint 2013. If you are pressed for time, you can just walk away with this recommendation: Don't use the copy and paste function! The copy function simply doesn't work well.

I had a workflow that, no matter what I changed, when I published it, it looked like it published successfully, but it actually didn't. I came across this link that mentioned copying an email can cause problems. The problem stems from SharePoint designer trying to copy the variables in the email. It just can't handle it. 

The beauty of copying an action is to avoid having to paste in all the workflow variables in a highly formatted email. If it can't handle the variables, then this is pretty much useless. I ended up deleting the emails I copied and re-creating each one by scratch and then it worked fine ( I didn't want to lose all the other work I had already put into the workflow by starting over). 

I suspect the problem would occur with any action involving variables you try and copy, so just stay away from the copy function. The link above mentioned that this is only an issue with tasks, but it's not worth figuring when it does or doesn't work.