Posts tagged with "Microsoft SharePoint"

SharePoint’s People Picker Error

Posted within Administration Development on by Ryan Ball

Since the roll out of Internet Explorer 10, our users were having trouble whenever they attempted to give someone access to their SharePoint 2010 area via the Grant Permissions dialog. Whenever they clicked the Browse icon, they’d receive a “An unexpected error has occurred” message.

One solution that seemed to solve this issue was to add the domain of the SharePoint site into the browser’s Compatibility View Settings – but that would effect all sites using the domain (including non-SharePoint sites).

While researching the issue I found a suggestion that it could be corrected by appending a META tag to one of the MasterPages.

Normally I wouldn’t dare edit one of the SharePoint core files, but as this was effecting so many users and we’ll be migrating to SharePoint 2013 in the near future, the benefits outweighed the risks.

  1. Browse to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS and locate the pickerdialog.master file.
  2. Immediately after the opening HEAD tag, insert the following line: <meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE8″ />

The changes appear to have resolved the issue completely.

Value does not fall within the expected range

Posted within Development on by Cornflower Design

The following code, which was supposed to update the “Current” Composed Look, was throwing a “value does not fall within the expected range” error each time I ran it.

SPWeb web = properties.Feature.Parent as SPWeb;
SPList gallery = web.GetCatalog(SPListTemplateType.DesignCatalog);

if (gallery != null)
{
    SPQuery q = new SPQuery();
    q.RowLimit = 1;
    q.Query = "<Where><Eq><FieldRef Name='DisplayOrder'/><Value Type='Number'>0</Value></Eq></Where>";
    q.ViewFields = "<FieldRef Name='DisplayOrder'/>";
    q.ViewFieldsOnly = true;

    SPListItemCollection items = gallery.GetItems(q);

    foreach (SPListItem item in items)
    {
        item["MasterPageUrl"] = web.MasterUrl;
        item.Update();
    }

}

After a lot of head scratching, it boiled down to the ViewFieldsOnly property which, which I had left set to true. Doh! Updating the property to false corrected the error.

See: SPQuery.ViewFieldsOnly property

The URL is not available, does not reference a SharePoint site, or you do not have permission to connect

Posted within Administration on by Cornflower Design

This is a handy thing to remember for an issue I just ran into. When you try to connect to a SharePoint URL from Dashboard Designer, you may see the following prompt:

“The URL is not available, does not reference a SharePoint site, or you do not have permission to connect”

To resolve the issue I had to ensure that the Service Account which was running PerformancePoint Services had been given owner-level access to the Content database.

SharePoint Content Type IDs

Posted within Administration on by Cornflower Design

This is a handy PowerShell snippet for returning a list of all Content Types and their IDs within a SharePoint site.

$site = Get-SPSite http://www.domain.com
$web = $site.RootWeb
ForEach( $contentType in $web.ContentTypes ) { Write-Host $contentType.Name": "$contentType.ID }

SharePoint 2013: Focus on Content

Posted within Development on by Cornflower Design

SharePoint 2013 has introduced a small Focus on Content icon to the ribbon bar which, for the MasterPages that support it, will show and hide portions of the page when clicked. This can be useful for hiding non-essential page elements.

When the icon is clicked, JavaScript will do two things:

  1. It creates a cookie, so the selection is remembered the next time the page is visited.
  2. It adds a new ms-fullscreenmode class to the page’s BODY tag.

So, via CSS, we can decide which elements of the page should be hidden via the Focus on Content functionality.

.ms-fullscreenmode #nonessentialcontent { display: none; }

Log into SharePoint 2013 as a different user

Posted within Administration on by Ryan Ball

The “Sign in as Different User” option that was present in SharePoint 2010 has now been removed for SharePoint 2013 (I assume because it caused a lot of confusion between Internet Explorer and Office if you were logged onto the PC under one account and into SharePoint as another).

You can get around this by visiting http://siteurl/_layouts/closeConnection.aspx?loginasanotheruser=true

Source: “Sign in as Different User” menu option is missing in SharePoint Server 2013

User Profile Synchronization Service Will Not Start

Posted within Administration on by Ryan Ball

Note to self: If a newly created User Profile Synchronization Service within SharePoint will not start…

  1. Confirm that the service account is a member of the Local Administrators group on the server.
  2. Restart the SharePoint Timer Service.

If in doubt, iisreset /noforce.

Trouble Shooting SharePoint Errors

Posted within Administration on by Ryan Ball

For viewing in command prompt:

Get-SPLogEvent | ?{$_.Correlation -eq "<GUID>"} | SELECT Area, Category, Level, EventID, Message | Format-List

Export the results as text file:

Get-SPLogEvent | ?{$_.Correlation -eq "<GUID>"} | SELECT Area, Category, Level, EventID, Message | Format-List > C:\Error.log

Results can be retrieved faster if the time span is limited:

Get-SPLogEvent -StartTime YYYY-MM-DDTHH:mm:ss | ?{$_.Correlation -eq "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"} | SELECT Area, Category, Level, EventID, Message | Format-List

Synching Event Categories Between Outlook and SharePoint

Posted within Administration on by Ryan Ball

Oddly, within SharePoint 2010 at least, when you connect a calendar to Outlook it will not synchronise the category information for the event. It seems that Outlook uses a field named Categories to store this information and SharePoint uses Category.

Although not ideal, we can resolve the issue by visiting the List Settings page for the calendar, opening the Event content type and adding Categories from the list of pre-existing columns.

Adding Hours to a SharePoint Date Column

Posted within Administration on by Ryan Ball

When working with calculated fields within SharePoint, there isn’t an inbuilt function that will allow you to add a specific number of hours to a date. You have to stop of a second and think about it – and the solution is quite simple.

While adding whole days is as simple as =[DateColumn]+5, to add hours you have to break things down. So to add eight hours…

=[DateColumn]+(1/24*8)

See this helpful blog post for more information.