Monday, 31 October 2011

Customizing SharePoint list form ruined the entire form

Customizing new form or edit form with SharePoint designer, some times ruined entire form if you delete ListFormWebart from the form.
This may also result in affecting other form of the same list.

We encounterd this problem once on our test environment. After searching heavily on internert I found below post which helped me a lot and saved my time.
http://blogs.msdn.com/b/dszabo/archive/2007/02/20/custom-list-newform-aspx-ruined-in-wss-3-0.aspx

The post gives you step by step things which you need to follow. Just to add one point, while following these steps make sure you save your work only after last step. Saving your work in between may ruined other form.

Quick Update
In case if you want to customize your edit form or new form, hide the ListFormWebPart control and insert the Custom List Form control to your page.



JavaScript and SharePoint List Form fields

Sometimes we need to hide some of the fields, set default value for fields, get the current value of fields on List new form, and edit form, display form.

We can achieve this using JavaScript.

To start with, Microsoft Team has given a good solution on this post http://blogs.msdn.com/b/sharepointdesigner/archive/2007/06/13/using-javascript-to-manipulate-a-list-form-field.aspx

But there are some catches, when we use code given in above post for controls like check box, multiple line textbox.
There is a very good post on cleverworkaround which has much improved JavaScript to overcome these controls.
http://www.cleverworkarounds.com/2008/02/07/more-sharepoint-branding-customisation-using-javascript-part-1/

To return values for SharePoint field types from newform and editform, below is good post given by Alexander on his blog SharePoint JavaScript
http://sharepointjavascript.wordpress.com/2008/12/02/return-value-of-all-sharepoint-fieldtypes-with-javascript/

Hope all these information will be helpful for all of you.

Thursday, 20 October 2011

How to add if else if statement in calculated columns of SharePoint 2007

This is what I want to achieve

if(status = "Bad")
then rating = 1
else if(status = "Good")
then rating = 2
else if(status == "Excellent")
then rating = 3

to achieve this I created a calculated column "Rating" and added below formula

=IF([status]="Bad",1,IF([status]="Good",2,IF([status]="Excellent",3)))

And it was returning perfect results required to me.

There are also lots of sample formulas available at below link:
http://office.microsoft.com/en-us/sharepoint-server-help/CH010176029.aspx?CTT=97
Related Posts Plugin for WordPress, Blogger...