Code snippet to add / modify columns in a list

It iterates through a whole site collection and wherever the list with name “test” it finds, It will do the changes. 1: using System; 2: using System.Collections.Generic; 3: using System.Text; 4: using Microsoft.SharePoint; 5:   6: namespace ConsoleApplication1 7: { 8: class Program 9: { 10: static void Main(string[] args) 11: { 12: using (SPSite…

0

Code sample to aggregate the text from "append changes" column to Multiline text field.

This is a code sample to copy all of the text from the “col1” column to “col2” column. To note again, “col1” is an "append changes" column so the previous edits of the comments field are stored in previous versions of the list item. 1: using System; 2: using System.Collections.Generic; 3: using System.Text; 4: using…

0

Resolution: SharePoint throws an error while adding to lists

Cause Column name’s internal name is different than the column name   Resolution We modified the list column names in the code sample by checking the actual column names from the list setting and after that we were able to add new items in the list. To identify the column name List -> Modify settings…

0

Resolution: MOSS: Event handler being called twice on an imported list template

Behavior/Symptoms: I registered an event handler with a (custom) content type and then added this content type to a (custom) list definition. I implemented the list definition as a feature and installed/activated it for a site collection. Then I created a list using this list definition and added some items to it. The content type…

2