Blog Archives

Bulk/Batch Approval/Rejection in a SharePoint 2010 library

My client had the requirement to bulk approve or reject items in a document library or list.  Using document sets wasn’t the solution as the only thing they had in common was that they all need to be approved at the same time.

I found this excellent solution from Sohel’s blog which was almost perfect…

http://ranaictiu-technicalblog.blogspot.co.nz/2011/05/sharepoint-2010-approvereject-multiple.html

It handles workflow if they are running which other solutions I found didn’t.  One limitation was that it only worked for document libraries, not lists.

All I needed to do was update the elements file to below and I had it on both document libraries and lists.

<?xmlversion=1.0encoding=utf-8?>

<Elementsxmlns=http://schemas.microsoft.com/sharepoint/>

<CustomAction

Id=COB.SharePoint.Ribbon.NewControlInExistingGroup

Location=CommandUI.Ribbon

RegistrationType=ContentType

RegistrationId=0x01>

<CommandUIExtension>

<CommandUIDefinitions>

<CommandUIDefinitionLocation=Ribbon.ListItem.Workflow.Controls._children>

<ButtonId=COB.SharePoint.Ribbon.NewControlInExistingGroup.Notify

Command=COB.Command.NewControlInExistingGroup.Notify

Sequence=21

Image16by16=/_layouts/$Resources:core,Language;/images/formatmap16x16.png

Image16by16Top=-48Image16by16Left=-240

Image32by32=/_layouts/$Resources:core,Language;/images/formatmap32x32.png

Image32by32Top=-448Image32by32Left=-384

Description=Uses the notification area to display a message.

LabelText=Approve/Reject Selection

TemplateAlias=o1

/>

</CommandUIDefinition>

<CommandUIDefinitionLocation=Ribbon.Documents.Workflow.Controls._children>

<ButtonId=Ribbon.Documents.Workflow.ApproveDoc

Alt=Approve multiple items

Command=COB.Command.NewControlInExistingGroup.Notify

LabelText=Approve/Reject Selection

Image16by16=/_layouts/$Resources:core,Language;/images/formatmap16x16.png

Image16by16Top=-48Image16by16Left=-240

Image32by32=/_layouts/$Resources:core,Language;/images/formatmap32x32.png

Image32by32Top=-448Image32by32Left=-384

TemplateAlias=o1

/>

</CommandUIDefinition>

</CommandUIDefinitions>

<CommandUIHandlers>

<CommandUIHandler

Command=COB.Command.NewControlInExistingGroup.Notify

EnabledScript=javascript:enableApprovalAll();

CommandAction=javascript: showApproveAll();

/>

</CommandUIHandlers>

</CommandUIExtension>

</CustomAction>

<CustomAction

Id=COB.Command.NewControlInExistingGroup.Notify.Script

Location=ScriptLink

ScriptSrc =/_layouts/SharePoint.ApproveRejectTest/Scripts/ApproveReject.js/>

</Elements>

Advertisements

Create a custom Page Not Found page on SharePoint 2010

I’m sure all your SharePoint sites are far too great to have any internal broken links 😉

But there may be a situation when someone incorrectly links to your SharePoint site and you want to give a custom error page to provide a ‘nicer’  404 failure page and provide an opportunity for the user to seek more help or to be able to navigate elsewhere on your site.

go from this

page not found

to something like this

custom page not found

Here is how you do it

1. Create your custom ‘page not found’ page and approve it.  You probably  also want to remove it from any navigation and exclude it from search results.  I created my custom error page in the pages directory of the root site.

2. go to ..\14\TEMPLATE\LAYOUTS\1033 and take a copy of sps404.html and rename the copy to custom404.html

3. edit the file so that stsnavigate line points to the page you created in step 1

STSNavigate("/Pages/PageNotFound.aspx");

4. Open sp2010 management shell and run the following PowerShell commands (change <sitename> to your site URL)

$webapp =Get-SPWebApplication http://<sitename&gt;
$webapp.FileNotFoundPage = "custom404.html"
$webapp.update()

To redirect to a custom error page for other http errors see my other blog on How to Create a Custom Error Page on SharePoint


references 

http://support.microsoft.com/kb/941329