Trying to filter a list on its workflow status is pretty non-intuitive. You need the special status codes. Theese will work with all workflows in ShaePoint even Nintex workflows.

Status Code

Status Description

0

Not Started

1

Failed on Start

2

In Progress

3

Error Occurred

4

Cancelled (i.e. Stopped by User)

5

Completed

6

Failed on Start (retrying)

7

Error Occurred (retrying)

8

(unknown)

9

(unknown)

10

(unknown)

11

(unknown)

12

(unknown)

13

(unknown)

14

(unknown)

15

Cancelled

16

Approved

17

Rejected

Theese status codes can be used in editing list view query in both the user interface and the CAML in the list schema.xml

image005

 

image006

Another little special SharePoint speciality is that the workflow status field is referenced as the 8 first letters in the workflow instance name and the value type as WorkflowStatus

References:

Tags: , , , , , | Categories: Tips and tricks | SharePoint Development | SharePoint Configuration

QuerySting paramerters in the URL can help you edit pages where the edit button is missing (ex. SharePoint 2007 list views) or you need to throw away a web part that’s messing with your page from the web part maintenance view.

Function URL
Add Web Parts/Browse ToolPaneView=2
Add Web Parts/Search ToolPaneView=3
Edit Mode mode=edit
View mode mode=view
Shared view PageView=Shared
Personal view PageView=Personal
Maintenance view contents=1

You can combine some of the urls ex Edit personal view: …aspx?PageView=Personal&mode=edit

Tags: , , , | Categories: Tips and tricks | SharePoint Configuration

In SharePoint you can only view alerts per site. That means you cannot see all your alerts at once.

View my alerts on a site

At the top of the site, click User name , and then click My Settings, click My Alerts.

View alerts for other people on a site

As a Site Administrator you can view alerts of other users on your site through Site Actions -> Site Settings -> Under Site Administration -> User Alerts select the person whose alerts you want to view and select Update.

View all my alerts

There are several solutions for this, CodePlex and other SharePoint companies have some.
Outlook to the rescue! If you are using Exchange your Exchange mailbox will keep track of all your alerts and where these are subscribed from.
Choose Rules and Alerts.. select the Manage Alerts tab.

blog-manage-all-alerts - small

Tags: , , , | Categories: SharePoint Configuration | Tips and tricks

Using the in the the wrong parameter with the SPWeb.GetList method you will receive a FileNotFoundException with the following very SharePoint-ish error message:

System.IO.FileNotFoundException: <nativehr>0x80070002</nativehr>
<nativestack></nativestack><nativehr>0x80070002</nativehr>
<nativestack></nativestack>

The stacktrace will often give more information but the ULS log it wil simply show:

<nativehr>0x80070002</nativehr>
<nativestack></nativestack>

So the parameter is incorrect; Either the URL does not specify a valid path to the website, or the list does not exist in the website.

The GetList method gets the list that is associated with the specified server-relative URL to the root folder of a list, such as /sites/sitecollection/subsite/Lists/Announcements.

HINT

You can use the SPUrlUtility.CombineUrl with your webs server relative URL like this:

var list = web.GetList(SPUrlUtility.CombineUrl(web.ServerRelativeUrl, 
"lists/" + listFolderName));

I prefer to use the SPWeb.GetList over the SPWeb.Lists Property. Endusers can easy change the list title in the GUI but it is harder to change its URL.

Be aware; there are other methods casting System.IO.FileNotFoundException!

Tags: , , , | Categories: SharePoint Development | Tips and tricks

The SharePoint Config log DB can grow quite large!

The following way can help you shrink the config databases. But do only use these in test or development enviroments!

SharePoint 2010 on SQL 2008 R2

  1. Right click on you DB -> Properties
  2. Select Options
  3. Change the Recovery Model to SIMPLE and Click Ok
Once that is done ,
-Right click on DB -> Tasks - > Shrink -> Files
- In File type select log and click OK
 
Note : Simple recovery model is not suggested for Production Systems
 

SharePoint 2007 on SQL 2005

Make two new Queries

BACKUP LOG [Sharepoint_Config] WITH TRUNCATE_ONLY
USE [SharePoint_Config]
GO
 

DBCC SHRINKFILE (N’SharePoint_Config_log’ , 50)
GO



Tags: , , | Categories: Database | SharePoint Development