SharePoint Server-Side Object Model

learn more… | top users | synonyms

0
votes
0answers
6 views

Unable to update RichTextMode from Compatible to FullHtml

As the title says, I am unable to update the RichTextMode property of the Description field on a Calendar List. I am trying to update the field so that it supports "Enhanced Rich Text". Snipp: ...
0
votes
0answers
13 views

Change XsltListViewWebPart ListView setting

I am programmatically creating a Community Site and with that comes a XsltListViewWebPart on the Community's homepage. I am now trying to change the Selected View property from <Current view> ...
0
votes
1answer
27 views

Order Discussion Board by latest reply date else order by created date

I am trying to order a discussion list by the latest reply date, else if it doesn't have a reply order it by the thread created date. This is what I have: SPList discussionList = ...
0
votes
2answers
19 views

Adding SPNavigationNode Shows Incorrect Title

When adding a navigation node as like so: foreach (SPNavigationNode node in web.Navigation.QuickLaunch) { if (node.Title == "Parent Title") { SPNavigationNode newNode = new ...
0
votes
1answer
14 views

Allow Posts and Discussions to use same Categories lookup field

I am creating a Community site and activating the BlogContent feature on that site. There are conflicting issues, because the Community Site and the BlogContent feature both create a Lookup List ...
0
votes
1answer
36 views

Programmatically add XsltListViewWebPart to Community Homepage

As you may know, when you create a Community site, it automatically creates a discussion list which is added to /SitePages/Community Home.aspx which looks like so. I am trying to replace this with ...
0
votes
2answers
46 views

C# SSOM turn on List Rating settings

I have been using the method described here by attempting to use reflection to turn on the Rating Settings of a list. However, I get the following error: Exception Message: exception has been thrown ...
0
votes
1answer
57 views

SSOM Embed Code when inserting list item

Clicking this button in the list's ribbon, I can properly embed HTML so SharePoint doesn't strip anything out. I have some HTML that I need to insert into a list item field via C# code. How do I ...
0
votes
1answer
29 views

How to get the homepage / welcome page of a web with site.WebTemplate PROJECTSITE

to check if a user account has access to the homepage of a site collection, I have to get the root web's homepage. In most cases it works by using using (SPWeb web = site.RootWeb) { String ...
0
votes
0answers
44 views

Access Denied reading list with RunWithElevatedPrivileges

I am trying to read a list with a user without read permissions. I am using runWithElevatedPriviliges and I get this error: Access denied. You do not have permission to perform this action or ...
0
votes
1answer
46 views

Error on web.Webs.Add, Invalid Characters

I'm currently trying to create a Sub Web on a Site. The problem I'm faced with is that for some reason I'm getting an strange error message. Additional information: ...
2
votes
1answer
1k views

Major Differences between CSOM and SSOM [duplicate]

I know the differences between client side and server side scripting on a web application. But when it comes to SharePoint what exactly means client side and server side?
0
votes
1answer
53 views

Looping through active directory nested security groups in SharePoint

Is there a way to loop through the nested security groups in active directory, with or without using LDAP in SharePoint?? I have tried SPUtility.GetPrincipalsInGroup but Im not geting nested groups ...
1
vote
1answer
2k views

How to parse the output returned from REST (/_api/)?

When we use REST we get output as xml how do we parse this via JSOM and fetch the values? Also, please provide some information on how to use this in SSOM instead of JSOM?
0
votes
1answer
26 views

How can we display the email-id and profile picture of loggedin user on a webpart?

In SharePoint 2013, using SSOM, we need to display the email-id and profile picture of loggedin user on a webpart? What is best practice? Do I need to use SPContext.Current.User or Do I use the ...
1
vote
1answer
99 views

ICustomRouter interface >> CSOM or Server Side Object model

We are looking into a custom document route, and I know about the ICustomRouter interface. Can it be used in CSOM? The ICustomeRouter example here: ...
0
votes
0answers
106 views

Route documents to another site collection if approaching size limit

We'd like to have a Drop Off library look @ the current site size, and if it is approaching a limit, send the file to a different site within the site collection. It's kind of like a "you are ...
1
vote
1answer
442 views

How do I “follow site” in SharePoint with SSOM?

I haven't found that much information online about how to utilize the Social Part of SharePoint 2013 by Server Object Model. To understand and follow my question better i recommend you going to this ...
2
votes
2answers
171 views

how do I update user profile property in SharePoint 2013

We are using sp2013. There is a custom user profile property with name: MyProperty (boolean). The property cannot be edited by user. I want to update the property value for current user on an ...
2
votes
2answers
670 views

How do I fetch the data from list present in root web of the root site collection?

We need to populate some data on an application page. The application page is present in the layouts folder and hence is accessible via the respective site URL. There are multiple site collections. ...
1
vote
1answer
526 views

Reading and writing user profile properties using SSOM

The code works. There is no error. Please let me know if this is the best practice to read/write to the user profile property in SharePoint 2013. Read: string currentUser = ...
0
votes
2answers
278 views

what permissions are needed for writing to uls logs?

We have creates a webpart and in the catch block we are writing logs to uls. My concern is regarding permission to write to this log. Will users with read-only access to sharepoint face no issue? ...
0
votes
2answers
241 views

How to get the root site collection programaticallty via SSON and ECMA?

We have created web application. Within this we created 2 site collection: Site collection 1 - http://pcname:3333/ Site collection 2 - http://pcname:3333/sites/sc2 Within each site collection we ...
1
vote
3answers
900 views

How to access Root Site Collection from other site collections?

we have a user control on the master page (this masterpage is applied to all sites in the web application). User control code: SPSite spsite = new SPSite(SPContext.Current.Web.Url); ...
8
votes
2answers
137 views

How do I delimit Property bag values so search treats them as individual searchable words?

Currently I am using the property bag with values that are comma separated something like: web.AllProperties["fruits"] = "bananas, apples, oranges, tomatoes"; Currently search is treating them as ...
0
votes
1answer
140 views

Creating publishing pages using SharePoint Server Object Model in SP 2010

I am trying to create new pages in my publishing site(need to use a custom page layout) using SharePoint Server Object Model. I couldn't find much help on this topic from internet. Happy to have some ...
4
votes
1answer
210 views

SPFarm.Local Object Being Cached in SharePoint 2013

I am experiencing an odd issue where the SPFarm.Local object is not being updated for SharePoint 2013, but it does for 2010. Basically I have some code that adds/deploys/updates SharePoint solutions ...