Monday, June 9, 2008

"is Greater than or equal to" option is missing in the filter criteria in Sarepoint Designer

Most of the users face some problems with not having the right operators in the Filter Criteria dialog of a DataForm Web Part speciall when they are trying to filter by was a date.


 After doing lots of R & D I found out two reasons for not able to see this option. Here is the resolution

Resolution 1
One of my sharepoint there was a Lookup column which referred to a list that no longer existed. Note the lack of List name for where it’s getting information:


After deleting this column, I am able to see my all the missing options


After deleting this column, I am able to see my all the missing options

Resolution 2

I also got another solution from http://geekswithblogs.net/naijacoder/archive/2007/10/15/116060.aspx

Once of my end user have same problem and using option 2, his problem was resolved.

Tuesday, May 20, 2008

How to Shrink SharePoint content database size?

Run following SQL command to free up space of sharepoint content database

dbcc shrinkdatabase(WSSContentDatabaseName)

Saturday, May 3, 2008

How to Hide Fields in SharePoint List Form Pages using jQuery

Yesterday, one of friend ask me can we show/hide fields in Newform.aspx and Editform.aspx by clicking on checkbox. It can be done thru sharepoint designer with some rules. But I used jQuery with few lines of code in Task List. I added 1 more field i.e. ShowFields as choice field.


























Then I added a content editor webpart on newform.aspx. MOSS wont allow to edit newform.aspx and editform.aspx. To add webpart on newforn.aspx / editform.aspx, add in &ToolPaneView=2 on the end of the url. So your url for newform.aspx will be http://portal/Lists/Tasks/NewForm.aspx?RootFolder=%2FLists%2FTasks&Source=http%3A%2F%2Fportal%2FLists%2FTasks%2FAllItems%2Easpx&ToolPaneView=2

In source editor of content editor web part, I have added following script

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>

<script>
$(document).ready(function()
{
$("input[title$='ShowFields']").click(function()
{
$("input[title$='Title']").parent('span').parent('td').parent('tr').toggle();
$("nobr:contains('Start Date')").parent('h3').parent('td').parent('tr').toggle();
$("nobr:contains('Due Date')").parent('h3').parent('td').parent('tr').toggle();
});
});
</script>

and close the webpart page. Then open newform.aspx, now whenever I click on Showfields Checkbox then Title/Start Date/Due Date fields are hidden, once I uncheck this it shows the fields again.

Saturday, April 19, 2008

How to set permission and restrict view to particular user

Using following tool you can set permissions to views and restrict views to particular users. This feature is not available in MOSS 2007.

http://www.codeplex.com/SPViewPermission

Saturday, April 12, 2008

How to set field permission in Sharepoint List

Folllowint tool providing advanced settings to customize list form rendering in new, display and edit mode.

http://splistdisplaysetting.codeplex.com/