Sharing the experience search

Search sharing-the-experience.blogspot.com

Monday, August 23, 2010

5 system sharepoint files that make you life easy

5 system sharepoint files that make you life easy

COMException (0x80004005): Cannot complete this action.

The dreadful error in SharePoint! What I have noticed that if I am having this error, the ULS log won't gonna help me! I guess whoever reads this post waiting for resolution not for a whine) Here we go - look up the System Event Log. At some point it might some problem of you custom code.

Thursday, August 5, 2010

Sharepoint: How to survive after the first deployment on Prod

I have encountered a main problem with update the existing site which was created from custom site definition. It's almost impossible to guarantee that site will survive in case something is changed in the list schema.
It's worth to notice - that described method above is not supported by Microsoft:




 Here is a helpful terminology about the site definition and site template


And finally as a "panacea" for all this deployment hell :feature stapling
The real example how I use it here

In essence, you can't deploy a new list schema (ex. remove some fields, change type for existing fields) over already deployed site. The only way to do it -through object model.

Here is the additional tips about the object model pitfalls:
Additional tips about Sharepoint API

Just found old and "unsupported" msdn article which cast the light about difficulties of sharepoint redeployment:
Adding Functionality That Affects the Existing Application

Tuesday, July 27, 2010

sharepoint list new! icon - don't want to see it?

1.stsadm.exe -o setproperty -pn days-to-show-new-icon -pv 0 -url http://yourwebsite

2.Or more a gentle way to remove "New!"  from the list view web part - convert it into  a XSLT web part



and then delete the following line:

<xsl:if test="ddwrt:IfNew(string(@Created))"><IMG SRC="/_layouts/1033/images/new.gif" alt="New" /></xsl:if>   
  This second approach allows to keep the functionality throughout the site but you can customized the particular web part on the specified page
                                                           

site collection size

STSADM.exe -o enumsites -url htt:// YOURSITENAMEHERE > SiteList.txt
It will give a short description where site stores and how much space it consumes

Thursday, July 15, 2010

Exception from HRESULT: 0x80040E14

Recently I bumped into the error HRESULT: 0x80040E14 when I was trying to save the item in list after new changes that I made in schema.
The log didn't show a reasonable explanation - the old error like this "Unexpected query execution failure, error code 8143. Additional error information from SQL Server is included below. "Parameter '@nvarchar7' was supplied multiple times."  which supposed to mean that I have put in schema nonunique value in the param "ColName". This attribute serves to name the field on the sql table level. As I previously recommended - never never put this attribute in your schema - it will cost you pain, a lots of pain....
But anyway, that wasn't a case , I didn't see that attribute in my schema. When I looked at the SharePoint manager - I saw that it's true  - some fields has nonunique colname - Sharepoint by itself created thouse creepy value!!!
It turns out that additional attribute "ROWORDINAL"  causes the isssue.


As soon as I deleted it - it works perfectly!!

Microsoft is vert consice about this attribute:
RowOrdinal
Optional Integer. Specifies the database location for the field.

Thursday, July 8, 2010

When to use an Event Handler rather than a Workflow

In general, you will want to create an event handler rather than a workflow when you need to attach small bits of code that will run immediately before or after a list event has occured.
 As a rule of thumb, if your event handler must perform more than one or two operations (for example, updating some fields, validation data, or sending an email), you should consider using a workflow rather than an event handler.

Quoted from nice and easy to read book
SharePoint 2007 Development Recipes: A Problem-Solution Approach (Expert's Voice in Sharepoint)