List of SharePoint Lists BaseTemplateType

SharePoint has many Lists. Following is a list of BaseTemplateType of some of the SharePoint List that I know for a quick reference.

Notused -1
NoListTemplate 0
GenericList 100
DocumentLibrary 101
Survey 102
Links 103
Announcements 104
Contacts 105
Events 106
Tasks 107
DiscussionBoard 108
PictureLibrary 109
DataSources 110
WebTemplateCatalog 111
UserInformation 112
WebPartCatalog 113
ListTemplateCatalog 114
XMLForm 115
MasterPageCatalog 116
NoCodeWorkflows 117
WorkflowProcess 118
WebPageLibrary 119
CustomGrid 120
SolutionCatalog 121
NoCodePublic 122
ThemeCatalog 123
DesignCatalog 124
AppDataCatalog 125
DataConnectionLibrary 130
WorkflowHistory 140
GanttTasks 150
HelpLibrary 151
AccessRequest 160
PromotedLinks 170
TasksWithTimelineAndHierarchy 171
MaintenanceLogs 175
Meetings 200
Agenda 201
MeetingUser 202
Decision 204
MeetingObjective 207
TextBox 210
ThingsToBring 211
HomePageLibrary 212
Posts 301
Comments 302
Categories 303
Facility 402
Whereabouts 403
CallTrack 404
Circulation 405
Timecard 420
Holidays 421
StatusList 432
ReportLibrary 433
IMEDic 499
Microfeed 544
AnnouncementTiles 563
ExternalList 600
MySiteDocumentLibrary 700
PublishingPageLibrary 850
AssetLibrary 851
IssueTracking 1100
AdminTasks 1200
HealthRules 1220
HealthReports 1221
DeveloperSiteDraftApps 1230
PersonalDocumentLibrary 2002
PrivateDocumentLibrary 2003
AccessApp 3100
Sharing Links 3300
wfsvc 4501

Again it’s not a complete list, it’s just a list of all the SharePoint List BaseTemplateType that I am aware of. I might have to further modify it in the future.


Create a SharePoint View with Custom Url Client Object Model C#

In Client Object Model, you don’t have any option to set the url of the view that you’re creating. The url is automatically set as per the Title of your View. So if your Views title is say, My View, then its url will become My%20View. So how you can set the url as MyView instead of the My%20View?

Well, there’s an easy way-out. While creating the View, set its Title to the value that you want its url to have. So, for the above ex, create the view with the title MyView, so that its url will become MyView. Then afterwards, once the view is created, rename the title as you wish say, My View, your url however will not change and you’ll get your new view with the custom title at the desired location.

ClientContext ctx = new ClientContext(weburl);
ctx.Credentials = new SharePointOnlineCredentials(userName, passWord); 

List list = ctx.Web.Lists.GetByTitle("ListTitle");
SP.ViewCreationInformation viewCreationInformation = new SP.ViewCreationInformation();

//setting the title as per the desired url
viewCreationInformation.Title = "MyView";
viewCreationInformation.ViewTypeKind = (SP.ViewType)Enum.Parse(typeof(SP.ViewType), "HTML", true);
viewCreationInformation.RowLimit = 30;
viewCreationInformation.Query = "";
viewCreationInformation.SetAsDefaultView = true;

View newView = list.Views.Add(viewCreationInformation);

this.ctx.Load(list.Views);this.ctx.ExecuteQuery;

//set your custom title once your view has been created at the desired location/url
newView.Title = "My View";
newView.Update();
this.ctx.ExecuteQuery;

Update a UserMulti Column value in Client Object Model C#

Update the value of User/UserMulti column in SharePoint using Client Object Model
ClientContext ctx = new ClientContext(weburl);
ctx.Credentials = new SharePointOnlineCredentials(userName, passWord); 

List list = ctx.Web.Lists.GetByTitle("ListTitle");
ListItem currentItem = list.GetItemById(1);

FieldUserValue[] userValueCollection = new FieldUserValue[1];

//Get all the users of this Web
UserCollection userCollection = this.ctx.Web.SiteUsers; 
this.ctx.Load(userCollection, w => w.Include(p => p.Id, p => p.Title));
this.ctx.ExecuteQuery(this.ctx);

User user = userCollection.FirstOrDefault(p => p.Title.ToLower().Trim() == userTitle.ToLower().Trim());

//Making sure that a user of title userTitle is present in this Web
if (user != null)
{
    FieldUserValue fieldUserVal = new FieldUserValue();
    fieldUserVal.LookupId = user.Id;
    userValueCollection.SetValue(fieldUserVal, 0);
}

currentItem["MultiUserValCol"] = userValueCollection;
currentItem.Update(); 
this.ctx.ExecuteQuery(); 

As you can see that updating a multiUser column is along the same line as updating a LookupMulti column. Hence, there are a couple of things that one should take care of while updating this column. Those are mentioned in my previous blog where I have discussed about updating a LookupMulti column. here. https://realmpksharepoint.wordpress.com/2014/01/19/update-a-lookupmulti-column-value-in-sharepoint-using-client-object-model-c/

Update a LookupMulti Column value in SharePoint using Client Object Model C#

Update the value of LookupMulti column in SharePoint using the Client Object Model
ClientContext ctx = new ClientContext(weburl);
ctx.Credentials = new SharePointOnlineCredentials(userName, passWord); 

List list = ctx.Web.Lists.GetByTitle("ListTitle");
ListItem currentItem = list.GetItemById(1);

FieldLookupValue[] lookupFieldValCollection = new FieldLookupValue[3];FieldLookupValue lookupFieldA = new FieldLookupValue();
lookupFieldA.LookupId = 2;
lookupFieldValCollection.SetValue(lookupFieldA, 0);
FieldLookupValue lookupFieldB = new FieldLookupValue();
lookupFieldB.LookupId = 4;
lookupFieldValCollection.SetValue(lookupFieldB, 1);
FieldLookupValue lookupFieldC = new FieldLookupValue();
lookupFieldC.LookupId = 6;
lookupFieldValCollection.SetValue(lookupFieldC, 2);

currentItem["MultiLookupValCol"] = lookupFieldValCollection;
currentItem.Update();

ctx.ExecuteQuery();  

Two important thing I would like to share here,

  • Initially I tried to pass an array of an array of integer [containing the ids of the item] to the LookupMulti column which generated the error: Value does not fall between the specified range
  • Another thing was then I created a List of type FieldLookupValue and then I passed the List to the column using its ToArray(). I guess we just had to pass the array of FieldLookupValue. However, this resulted in the error: Unknown Error. Don’t know what that means.

Finally, I can say that create the array of type FieldLookupValue and populate this array using its SetValue method only.

SharePoint Client Object Model Error: The file or folder name contains characters that are not permitted. Please use a different name.

One of the big drawbacks of the SharePoint Client Object Model (CSOM) is that it has very little documentation. This error was thrown when I tried to create a new List using the class ListCreationInformation for a Developer Site. ListCreationInformation class has one property, Url. Now msdn says, it Gets or sets value that specifies the site-relative URL of the location for the new list. http://msdn.microsoft.com/EN-US/library/office/microsoft.sharepoint.client.listcreationinformation.url.aspxI thought as with other cases, I am supposed to enter the serverRelativeUrl here. Hence I set a value something like sites/ParentWebUrl/ListRootFolderName. Now when I tried to run the code I got this error:: The file or folder name contains characters that are not permitted. Please use a different name.

Next, just for the sake of testing, I passed only the ListRootFolderName and, the code ran successfully! The List was successfully created with proper values.

I have only faced this issue for a Developer Site. I have tested this condition on Publishing Site, Blog, & Developer Site only.

Still following is a short list of characters that cannot be set as a file/folder names in SharePoint

Site names, subsite names, or site group names

You cannot use the following characters anywhere in a site name, in a subsite name, or in a site or Active Directory group name:

  • Tilde (~)
  • Number sign (#)
  • Percent (%)
  • Ampersand (&)
  • Asterisk (*)
  • Braces ({ })
  • Backslash (\)
  • Colon (:)
  • Angle brackets ()
  • Question mark (?)
  • Slash (/)
  • Plus sign (+)
  • Pipe (|)
  • Quotation mark (“)
  • You cannot start a site name, a subsite name, or a site group name with an underscore (_) character or with the period (.) character.
  • When you create a site name, a subsite name, or a site group name, you cannot use strings that were already used to name managed paths.
  • You cannot use the period character consecutively in the middle of a site name, a subsite name, or a site group name.
  • You cannot use the period character at the end of a site name, a subsite name, or a site group name.

Folder names

You cannot use the following characters anywhere in a folder name or a server name:
  • Tilde
  • Number sign
  • Percent
  • Ampersand
  • Asterisk
  • Braces
  • Backslash
  • Colon
  • Angle brackets
  • Question mark
  • Slash
  • Pipe
  • Quotation mark
  • You cannot use the period character consecutively in the middle of a folder name.
  • You cannot use the period character at the end of a folder name.
  • You cannot start a folder name with a period character.

File names

You cannot use the following characters anywhere in a file name:
  • Tilde
  • Number sign
  • Percent
  • Ampersand
  • Asterisk
  • Braces
  • Backslash
  • Colon
  • Angle brackets
  • Question mark
  • Slash
  • Pipe
  • Quotation mark
  • You cannot use the period character consecutively in the middle of a file name.
  • You cannot use the period character at the end of a file name.
  • You cannot start a file name by using the period character.
  • In addition, file names and folder names may not end with any of the following strings:
    1. .files
    2. _files
    3. -Dateien
    4. _bestanden
    5. _file
    6. _archivos
    7. -filer
    8. _tiedostot
    9. _pliki
    10. _soubory
    11. _elemei
    12. _ficheiros
    13. _arquivos
    14. _dosyalar
    15. _datoteke
    16. _fitxers
    17. _failid
    18. _fails
    19. _bylos
    20. _fajlovi
    21. _fitxategiak

Full details can be found here.