Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [ssom]

SharePoint Server-Side Object Model

2
votes
2answers
83 views

Code for Activating and Deactivating Audit Feature

I am seeking for Server Object model to Activate and deactivate the SharePoint Audit Feature. Can any one help me how can I achieve this?
1
vote
0answers
169 views

SP13 - Video is uploaded in Asset library programmatically, but preview image doesn't show up

I want to upload video file in asset library with SSOM. This is my code: SPFolder newFolder = videoFilesLibEN.RootFolder.SubFolders.Add("Video"); SPFile spfile = newFolder.Files.Add("VideoName....
4
votes
1answer
201 views

Accessing SharePoint using the object model with impersonation

I have a SharePoint web application which contains two applications. Sp.test.com => SharePoint web application, claims based authentication. Employees => Employees application, authentication with AD ...
1
vote
0answers
46 views

Get the Report of Site Collection Changes without enabling Auditing

I have come ac-crossed to annoying requirement , Where I need to get the report of changes made in site collection with out enabling "Audit" feature in SharePoint 2013 Can any one help me or guide me ...
3
votes
1answer
102 views

SP 2013 SSOM Checkin DirectoryNotFoundException

Trying to recurse through a folder and checkout or checkin all files. But i keep getting a DirectoryNotFoundException on the checkin. Oddly enough, i manually uploaded a file to the Agency folder (the ...
7
votes
2answers
501 views

Using CAML Builder Is it possible to query the items from multiple list in SharePoint 2013?

I have three lists like List1, List2, List3. I need to retrieve an item based on conditions, Is this possible to query the items from multiple lists using Caml query builder tool U2U. I am not sure ...
1
vote
1answer
34 views

minimal rights needed to write powershell scripts

I got some CSOM scripts in a .Net Application, that I have to to move to the server, using the server object model/powershell. As our Sharepoint team has no time and skills, it was decided that I have ...
0
votes
1answer
23 views

Fetch the Doc lib object by passing the Internal Name of Doc Lib [ NOT Display Name]

I want to fetch the document library object by passing the internalname of the doc lib. is it possible? like splist mydoclib = ospweb.lists.trygetlist("INTERNALNAME_OF_DOCLIB"); usually we pass ...
1
vote
0answers
36 views

Unmanaged memory leak of OWSSRVR in SharePoint 2013 Windows Service

I have a Windows Service running on the SP2013 front-end server. The service uses SSOM API to access SharePoint Farm. In general, the service periodically gets some items from various site collections ...
1
vote
0answers
127 views

Extract data from ows_MetaInfo

I'm trying to extract all data from an SPListItem. Most of the data is in the ows_MetaInfo attribute in some strange format. Is there a way to either deserialize ows_MetaInfo, or get the fields in an ...
5
votes
1answer
3k views

SharePoint 2013 Batch update list items C# SSOM

I am trying to use batch update for one of the list in SP2013 site. I am trying to run a simple batch request as follows. using (var spSite = new SPSite(siteName)) using (var spWeb = ...
0
votes
1answer
66 views

How i can get the current PublishingSite & PublishingWeb from SPItemEventProperties inside my Event Recevier

I have an publishing site collection using the enterprise wiki site collection template inside my sharepoint server 2013. And inside the root site of my site collection i added a custom list named "...
0
votes
2answers
423 views

“Collection was modified; enumeration operation ..” error when removing a column

I have wrote the following code inside my console application, the purpose is to loop through all the current sub-sites, and then loop through all the current lists. If the default list view contain a ...
1
vote
1answer
1k views

Alternative to using (Event Receivers & Server-side object model) when working with Office 365 sharepoint

I have being working with on-premise sharepoint 2013. and a lot of functionalities i have been doing were implemented inside Event Receivers when item added/updated. Where inside Visual Studio 2012 ...
0
votes
2answers
835 views

How to loop through all subsites under a subsite using SharePoint server object model

I want to write the following inside a c# console application:- I have a site collection http://servername/ This site collection have a subsite http://servername/customers/ And inside the customers ...
0
votes
2answers
1k views

Get value of PeopleEditor control field in a string

How can I retrieve value of SharePoint:PeopleEditor control in a string programmatically in Server Side Object Model (C#)?
1
vote
1answer
313 views

SP - How to get site(name/title) from navigation?

I want to get title/Url from of site navigation in sharepoint programmatically. how to do this ? I have only Current.Site.Web.Url, but not have a child to get site with index.. using (SPSite oSite =...
0
votes
2answers
229 views

Disposing SharePoint Objects

If you open a SharePoint list like this var site = new SPSite(url); var web = site.OpenWeb(); var list = web.Lists["ListName"]; Is it OK to dispose site and web through properties of the list? var ...
0
votes
1answer
86 views

Audit users accessing site

I know analytic reports for visits and hits for a site, it doesn't show who all accessed and time. I want to audit users accessing site. Is there any way to do it using Server Object Model or other? ...
2
votes
1answer
114 views

List Attachment

Can you give me a brief on how Attachment List is linked to a specific item and how does it work, I want to customize it to filter the attached documents
-1
votes
1answer
628 views

feature is site-scoped and cannot be added to the web sharepoint 2010

Iam deploying solution to site scoped feature , and in feature activated event receiver iam writing the code to activate feature to all subsites but error is "feature is site-scoped and cannot be ...
0
votes
2answers
433 views

Programmatically Create Site Collection within a Specific Content DB or move to a specific Content DB using SP Object Model & Not PowerShell

Is it possible to specify the Content DB to which a site collection will belong while creating a Site Collection? I am using the SelfServiceCreateSite API. If not, is there a way to move a site ...
0
votes
5answers
18k views

How to read items from folder in SharePoint List/Library Programmatically C#

There is a image library that contains different folders. I am trying to fetch all the items with items count from inside the folders using CAML query but its fetching all items from root folder and ...
1
vote
2answers
84 views

Event Receiver SharePoint list- Is there something like properties.AfterProperties to use for text coulmns?

I tried using properties.AfterProperties in event receiver that I am using for sending updates in SharePoint list to specific e-mail addresses. So far I found that it's working well with yes/no ...
3
votes
0answers
99 views

What does it mean when a message for a thrown exception is a GUID

I noticed this unexpected entry in the trace log on one of our on-premise 2013 farms: 85c6b8ca-b2a3-4c6e-8a9f-d60d96224577 Stack trace: at Microsoft.SharePoint.SPFile.GetFileStream(...
2
votes
2answers
506 views

Calendar List - CAML Query Next Two Events

I need to create a CAML query to obtain the following two events from a SharePoint 2010 calendar: To consider: There may be recurring events And exceptions to events The purpose is to show in a ...
3
votes
2answers
2k views

Check if user profile exist programmatically

I am trying to get user profile image from user profile. Here is my code sample: SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite site = new SPSite(...
1
vote
1answer
26 views

Error creating site from template with feature with module

I created with Visual Studio a module to uploade a file. And a feature associated. Currently the site has this feature desactivated. I create a site template based on this site. When I create a ...
1
vote
3answers
793 views

Application page as home page

I am developing a SharePoint 2010 Project totaly in Visual Studio and C#. I do not want to use SharePoint Designer and configuration via browser. I need to set a LAYOUT page (application page) as ...
0
votes
1answer
476 views

Console application triggering event receiver

I have console application collecting data from SQL and either creates or updates the item in a SP list. I have added an event receiver to that list, this triggers if an item has been updated and ...
1
vote
1answer
31 views

Enabling content type management for SPList fails

I have the following code: oWeb.Update(); oWeb.Lists.Add("SampleList", "Some description", SPListTemplateType.GenericList); oWeb.Update(); oWeb.Lists["SampleList"].ContentTypesEnabled = true; ...
-1
votes
2answers
476 views

How to refresh a sharepoint list from C# console application

Is there any way to refresh a SharePoint list from C# console application. NOTE: By refresh I mean the same that we achieve by doing a Ctrl + F5.
0
votes
1answer
21 views

SP07 - Get items from choice textbox and insert into DropDownList (-programmatically-)

I have a list (WayBill) with column(ProdyctType). I need to get these items and input then into dropDownList. This is my columnType in SP07: This is my code: protected override void ...
0
votes
1answer
582 views

Try get attachments to SPList

I tried using this solution with the following code: using (SPWeb web = site.OpenWeb()) { SPList list = web.Lists[ListName]; items = list.GetItems(); table = items....
4
votes
1answer
2k views

Get all users who have permission to a specific folder

I am working with SharePoint 2010 . I have a folder in my SharePoint document library. I am trying to get the users who have any permission or role to that folder programmatically. But can't find a ...
4
votes
2answers
285 views

SPUser.Groups is empty

I have an SPUser object generated from the currently logged in user via SPContext.Current.Web.CurrentUser however user.Groups is coming back empty. I checked the group, the user is in the group. ...
0
votes
1answer
802 views

How to clear browser cache or cookies when user logout?

I have custom signout.aspx page which is auto redirected when user session timeout expired. Problem is when user clicks the Back arrow or opens same site again, there is no prompt for authentication ...
20
votes
2answers
412 views

ProjectPolicy.SavePolicy() : server side giving error : The collection cannot be modified

Trying to modify ProjectPolicy Properties server side is giving me an error : List<ProjectPolicy> availPolicies = ProjectPolicy.GetProjectPolicies(web); ProjectPolicy policy = availPolicies....
0
votes
1answer
55 views

is either new SPSite(string url) or new SPSite(GUID guid) better than the other? how

I have cached access to either the Url or the GUID for multiple SharePoint site collections (SPSites), and I am trying to create new references to them for permissions purposes (SPSite constructor). ...
1
vote
0answers
47 views

Whether item.recycle method will trigger event receiver?

When an item.delete() methods get called it will trigger the respective item deleting and item deleted event receiver. Whether this will behave same for the item.recycle() method too.
0
votes
1answer
90 views

Failure to turn on list auditing programatically

I have a SPListEventReceiver with a ListAdded() override that responds to the creation of Document Libraries. What I am trying to do is turn on auditing for the newly created Document Library like so: ...
0
votes
3answers
2k views

How to get all the active directory users and groups in SharePoint using C# SSOM

I have two dropdown list in one of my custom webpart. I want to load all users and groups from an active directory into respective dropdown list on a form. I am making use of SSOM for developing a ...
0
votes
1answer
61 views

How to protect data of list item

As you know that Users with edit permission on List can edit List Item via CSOM or Rest API. It does not matter if the data is simple, but in case the data of list item is essential and stored with a ...
6
votes
2answers
137 views

SPContentTypeId.Empty vs default

Is there any reason to prefer SPContentTypeId.Empty over default? Console.WriteLine(default (SPContentTypeId)); // writes 0x Console.WriteLine(new SPContentTypeId()); // writes 0x Console.WriteLine(...
0
votes
1answer
439 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 = web.Lists["...
0
votes
2answers
303 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
247 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
2k 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
387 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
247 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 ...