Archive

Archive for June, 2010

MOSS – Change Maximum File Upload Limit

June 17th, 2010 Comments off

By default you can upload a maximum file of 50 MB in a SharePoint document library. It might be very rare when you want to increase this limit but sometime it happens. Recently it happened with me.
It’s not really difficult.
Open SharePoint Central Admin site
Click on Application Management
Click on Web Application General Settings

Now on this screen you can changes the maximum file upload size.

You may also need to change the timeout settings for your webpage to upload big files.
 

You may also need to change the timeout settings for your webpage to upload big files.

Have fun

Create Workflow Using SharePoint Designer 2007

June 13th, 2010 1 comment

It is part of the same series of workflows creation I started a few days ago. As promised this time here is the example to create a copy item workflow using SharePoint designer 2007 for SharePoint 2007. Obviously there is no much difference between the workflows creation process of SharePoint designer 2010 and SharePoint designer 2007.

This is an example for copy item workflow. Whenever you create or change an item in a list it will copy your item in the destination list.
Open the SharePoint designer and open your website. Select new from file menu and then Workflows to create a new workflow.

 

Give your workflow some name and select the list/library to initiate workflow. Also select when the workflow triggers. I selected on item created and item changed.

 

In this workflow we will put a condition. Actually I created a field in document library. This is a ‘Yes/No’ field. This workflow will check for the field value and triggers only if it is ‘Yes’.

 

Select the condition in workflow’s settings page and select the first option to compare list field for condition.

 

Select field name to MoveFlag from the drop down list.

Set the value to ‘Yes’ for condition. It defines that if MoveFlag value will be equal to Yes then this workflow will trigger.

Now it’s time to set the action statement. Your condition is done, now select Action. Select ‘Copy List Item’ from the drop down list.

 

Select the source list name in first instance and select destination list name in second instance. I selected the ‘Issued Documents’ library for source list. This statement will look like this.

 

All done, now just click finish it will process your workflow and associate it with the source list as well.

 

Now what else, start using the workflow. It’s ready and will work as required. In next post I will explore the programmatic way to create workflows. That would be more interesting I think.

Thanks

 Thanks

Check if User Has Permissions on List or WebSite

June 11th, 2010 3 comments

Recently I was working on a web part where I have to check for current user permissions for different lists in multiple sub-sites. I found a very straight forward method from SharePoint API. (DoesUserHavePermissions)

This method has some variations on site and list levels. 

On site level this method can take two parameters, string loginname and SPBasePermissions. You can use these parameters with two variations. If you don’t pass the login name then it verifies the permission level against the current user. SPBasePermissions is an enumeration. You can find more details about SPBasePermissions here.

On list level this method can again take two parameters, but three variations in method parameters. If you just pass the SPBasePermissions then it verifies the permission level against the current user. Then you can check permissions for a specific user and in third variation you can apply folder check. You can find more details on SPList.DoesUserHavePermissions here

You can use this method like this

if (oWeb.DoesUserHavePermissions(SPBasePermissions.ViewPages))
{
       SPList oList = oWeb.Lists[ListName];

        if (oList.DoesUserHavePermissions(SPBasePermissions.ViewListItems))
        {
         // some smart code
        }
}

Thanks

Web Part Management/Maintenance Page

June 11th, 2010 Comments off

Sometimes very small things make life difficult for you. Like any of your web part can mess up your page and you cannot view your page. You left with no other option to open the page in an editor like SharePoint Designer and then remove the web part to make your page working again.
There is a very simple solution without opening your page in SharePoint Designer, just put the ?contents=1 in the end of your page’s URL. It will open a Web Part Maintenance page. On this page you can easily close or remove any web part.

I hope you like the tip of the day.