Customizing MySite : SharePoint 2007

Customizing MySite : SharePoint 2007
MySite customization In this article we will discuss how we can personalize MySite. To customize the MySite we will use the Feature Stapling.  We will do the following : -          Adding custom...

How to localize site columns using resource files

How to localize site columns using resource files
Localizing SharePoint 2007 columns consist on  Create resource file for each language.  Add $Resources:<ResourceFilename>,<Resource key name>; to the display name of the site column. In this article we will create a resource file...

How to run Code with elevated privileges

How to run Code with elevated privileges
I had to create 2 calendars , first one is shared and located on the Root site and the other is personnal and located on the mySite. The content type contains one field  AssignedTo . when the event is inserted in the Shared Calendar , it must also...

How to get the DisplayForm of an SPListItem

How to get the DisplayForm of an SPListItem
this is a code snippet that get the display form of an SPListItem using (SPSite site = new SPSite("http://yoursite")) {     using (SPWeb web = site.OpenWeb())     {         SPList list = web.Lists[0];    ...

How to get Users Id from a UserMulti Field

How to get Users Id from a UserMulti Field
If you try to get the ToString() value of a type of UserMulti field you'll get something like "1;#Username" and for multi-user fields "1;#User1;#15;#UserX".  It is not necessary that you create a method that parses this string to get the users...

Retrieve field value after ItemAdded event using its GUID

Retrieve field value after ItemAdded event using its GUID
To retrieve the value of an item after the event ItemAdded , we can use the guid of the corresponding field.  public override void ItemAdded(SPItemEventProperties properties)         {            ...

How to add custom content type to a custom list

How to add custom content type to a custom list
To add a custom content type to a custom list definition , the simple way to do is to add some entries in the schema.xml of the list.  - Just add the ContentTypeRef of the contents types you want to use .  - Add EnableContentTypes="TRUE"...

Error when trying to deploy a sharepoint solution using VSeWSS 1.3

Error when trying to deploy a sharepoint solution using VSeWSS 1.3
 If you get the following error : Error: System.ServiceModel.ProtocolException System.ServiceModel.ProtocolException: The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (text/xml;...

Add a user pickup field in a custom content type

Add a user pickup field in a custom content type
It's seems to be difficult to create a pickup field for users or groups but it's really easy. This is a way to to this using the xml schema of our content type. < Field ID="{47A9E79B-705B-4586-B697-01B2609CEC1F}" Name="AffectedPersons" BaseType="Text" DisplayName="Personnes...

Deleting fields inherited from parent content type

Deleting fields inherited from parent content type
When inheriting from existing content type we inherit all fields. Some fields are some time not necessary so we need to delete theses fields from our Content Type. This is a sample code of how to remove the unwanted fields. So the solution is using...