Showing posts with label List Forms. Show all posts
Showing posts with label List Forms. Show all posts

Friday, February 17, 2012

Open SharePoint List Form in Edit Mode (New / Edit / View Form Pages)

I wanted to customize list's New form to load the JavaScript code by adding CEWP to auto populate some fields. But i could not find the option to Edit list form pages in the browser. i.e. New Form / Edit Form / View Form. It can be done using Designer but it is not handy.

I could edit the list form in the browser by using a simple technique.
Add the querystring &toolpaneview=2 at the end of the list form Url and hit ENTER.
That's it now the form is in edit mode, you can customize list form in the browser by adding web part or list views.

Friday, March 25, 2011

SharePoint Check Current User Permissions (SPBasePermissions)

I came accross a requirement where a custom web part or page displays the Generic List fields, however hide some of the fields if the current logged-in user doesn't have edit or delete list items permission.
using Microsoft.SharePoint;
if (!SPContext.Current.Web.DoesUserHavePermissions(SPBasePermissions.EditListItems))
{ 
//hide the fields/controls which are not supposed to be shown here
}
To see the OTB available list of permissions(SPBasePermissions) have a look at the post here.