Thursday, September 30, 2010

Where's the "Configure Incoming Email Settings" Link?

If you cannot see the "Configure incoming e-mail settings" link in SharePoint 2010 central administration, and are sure you have all the permissions you require, try right-clicking on an IE icon and selecting "Run as administrator" from the context menu. In that instance of Internet Explorer, you may well see the link you are seeking!

Thursday, September 16, 2010

Access Denied for Configure Service Accounts Link

Clicking on the "Configure Service Accounts" link on a SharePoint 2010 server resulted in an "Access Denied" message.

Resolution of this issue is to run IE with Elevated Permissions by right clicking on an IE shortcut and selecting "Run as administrator"

Friday, September 3, 2010

At Last - Tame the Core CSS FIle!

Thanks to the blog of buta no le, I could solve that nasty issue of corev4.css being placed after my custom CSS file when using the SharePoint.CSSRegistration tag.

The reason I want to use that tag is that it allows the use of tokens to derive the actual site collection URL (as opposed to having to hard code the URL, and then editing the masterpage on the client site). In MOSS, SharePoint.CSSRegistration always places the core CSS file at the end of all the registered CSS files, thereby rendering useless any style overrides in your own files.

But SharePoint 2010 adds the "After" attribute to the tag. Nice! Now I can insert the following in the masterpage, and dictate my own styles over the core ones (note that the name actually needs to be enclosed in angle brackets!)

SharePoint:CSSRegistrationName="% $SPUrl:~sitecollection/style library/state.css
%" After="corev4.css" Runat="server"/>

Wednesday, September 1, 2010

Where is disco.exe?

Just been searching for this web service tool, so to save the effort of the hunt next time, here's the location of the folder holding the file:

C:\Program Files\Microsoft SDKs\Windows\V6.0A\Bin\disco.exe

Monday, August 30, 2010

PowerShell PS1 File Not Recognised as the Name of ....

Annoying wee behaviour - if calling a PowerShell file from a batch file, it seems that even if the BAT and PS1 files are in the same folder, and the BAT file has changed the current path to be that folder, it is still necessary to include the whole path to the PS1 file in the -command call.

The statements
cd [the folder path]
powershell -command "&{.\test.ps1}"
didn't work, whereas the following does work:
cd [the folder path]
powershell - command "&{[the folder path]\test.ps1}"

Tuesday, July 27, 2010

SP2010 - Get the Item ID from the OpenPopUpPage Link

Just wanted to record here a simple little jQuery script useful for retrieving the item ID from the OpenPopUpPage hyperlink that is rendered for lookup column values in a Data View Web Part in SharePoint 2010. The useful thing about this is that you can then manipulate the action of the hyperlink to pass this item id to a different page - without having to look at changing the field type in any way.

The lookup field is rendered in a DVWP with the following onclick action:

OpenPopUpPage( 'http://blah/_layouts/listform.aspx?PageType=4&ListId={FFFC7FEA-62B2-459F-9D1B-80B6CA3608FF}&ID=23&RootFolder=*', RefreshPage);


The XSL (in the DVWP) that is rendering this lookup value is as follows:


Trust Partner:





[An aside: "table-based HTML?" you may ask. Well, sometimes expedience wins over web standards, though I am usually a standards-based advocate!]


The jQuery script to extract and use the item ID is:

$(function() {
$('.linktoentitydetails').each(function() {
var $link = $(this).find('a');
var href = $link.attr('href');
if (href != '') {
var itemIdMatches = href.match(/.*&id=(\d+)&.+/i)
if (itemIdMatches.length == 2) {
var itemId = itemIdMatches[1];
$link.removeAttr('onclick');
$link.attr('href', 'persondetails.aspx?eid=' + itemId);
}
}
});
});

So, in this case, I am replacing the OpenPopUpPage hyperlink action with a simple link to a custom page (persondetails.aspx) on which I can present other information about this linked item.

Saturday, May 29, 2010

SharePoint Connection Error in Visual Studio 2010

When running Visual Studio 2010 on a Windows Server 2008 R2 / SQL Server 2008 / SharePoint 2010 development box, even though the logged-in account has local admin rights on the server, I still experienced a SharePoint Connection Error in Visual Studio 2010 on that same Virtual Machine. The text in the error dialog states that "the local SharePoint Server is not available".

Seems the error is caused be the logged-in account having insufficient rights against the SharePoint databases. Log into the SQL Server using the administrator account, and grant rights to the developer account; db_owner rights on the SharePoint configuration and admin database is reported to be sufficient -but as in this instance I was dealing with a development virtual machine, I opted for the easy route of granting sysadmin role to the dev user account :-)