Tuesday, November 29, 2011

Unable to process the request (While opening an Excel document)

On opening the excel document stored in a document library it shows 'Unable to process the request. Wait a few miniutes and try performing this operation again.

To solve this, edit the 'serverfilesExcelServer.xml' available in the SharePoint 14 hive.

'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML'

Comment the lines containing the file extension of xlsx or xls.

<?xml version=”1.0″ encoding=”utf-8″ ?>
<!– Copyright (c) Microsoft Corporation. All rights reserved. –>
<ServerFiles>
     <!–<Mapping FileExtension=”xlsx” RedirectUrlTemplate=”/_layouts/xlviewer.aspx?id=|0″ NoGetRedirect=”TRUE” CreateRedirectUrlTemplate=”/_layouts/xlviewer.aspx?new=1″/> –>
     <Mapping FileExtension=”xlsb” RedirectUrlTemplate=”/_layouts/xlviewer.aspx?id=|0″ NoGetRedirect=”TRUE” CreateRedirectUrlTemplate=”/_layouts/xlviewer.aspx?new=1″/>
     <Mapping FileExtension=”xlsm” RedirectUrlTemplate=”/_layouts/xlviewer.aspx?id=|0″ NoGetRedirect=”TRUE” CreateRedirectUrlTemplate=”/_layouts/xlviewer.aspx?new=1″/>
 </ServerFiles>


Then perform an IISRESET which solves the problem.

Wednesday, November 16, 2011

SharePoint Developer Interview Questions – Answers

Adding Notification and Status in SharePoint through Client Object Model

<script language="ecmascript" type="text/ecmascript">
var statusId = '';
var notifyId = '';
function AddNotification() {
    notifyId = SP.UI.Notify.addNotification("Hello World!", true);
}
function RemoveNotification() {
    SP.UI.Notify.removeNotification(notifyId);
    notifyId  = '';
}
function AddStatus() {
    statusId = SP.UI.Status.addStatus("Status good!");
    SP.UI.Status.setStatusPriColor(statusId, 'red');
}
function RemoveLastStatus() {
    SP.UI.Status.removeStatus(statusId);
    statusId = '';
}
function RemoveAllStatus() {
    SP.UI.Status.removeAllStatus(true);
}
</script>
<input id="Button1" onclick="AddNotification()" type="button" value="Add Notification"/>
<input id="Button2" onclick="RemoveNotification()" type="button" value="Remove Notification"/>
<input id="Button3" onclick="AddStatus()" type="button" value="Add Status"/>
<input id="Button4" onclick="RemoveLastStatus()" type="button" value="Remove Last Status"/>
<input id="Button5" onclick="RemoveAllStatus()" type="button" value="Remove All Status"/>

How to launch a document by clicking a link to the file?

Word: <a href='ms-word:ofe|u|path/to/web/word/document.docx'>Link to document</a> Excel: <a href='ms-excel:o...