API for interacting with SharePoint from .NET code deployed to the server.

learn more… | top users | synonyms

1
vote
1answer
28 views

Can we distribute SharePoint DLLs with our application

Is my understanding of following page correct that we can distribute Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll with our application? Like we reference these DLLs in ...
0
votes
0answers
21 views

SharePoint search Client Object Model and Server Side Object Model

So I have two Console Search which I am testing out the usage of SharePoint Search Models via visual studio 2013. I encountered an issue where EnablePhonetic and EnableNicknames does not really work ...
1
vote
2answers
71 views

SharePoint get field value as text

For JSOM we have a great method called get_fieldValuesAsText that returns formatted field value. The same value as user can see it in the list. I am really supprised that I can't find anything like ...
3
votes
3answers
2k views

How can I implement SharePoint JSGrid filtering and grouping functionality?

I am working on SharePoint JSGrid. I am able to implement the sort functionality in JSGrid. Now I want to implement the grouping and filtering in my custom JSGrid. For filtering we have to attached ...
5
votes
2answers
8k views

How do I query a list using CAML and SPQuery?

I have a SPList but I don't need to go through everything in that list. I need to establish a CAML query so I can limit the list items. Then, go thru each item from the query result and do something. ...
9
votes
6answers
12k views

In which situation use SPSecurity.RunWithElevatedPrivileges with superusertoken?

i have given permission only read only to Users Group.so there are not access to see listitem or any list. i have create application page with SPGridview with bind listitem. this page access by this ...
1
vote
3answers
571 views

Accessed denied when attempting to permission folder using the Object Model API

I'm attempting to permission a folder using the Object Model API that is created by an ASP.NET page wrapped into a feature. I am able to create and permission the folder for users that are in the ...
7
votes
1answer
4k views

Checking existence before using GetItemById

I am getting an item by using GetItemById but I want to check before using it whether the item exists or not. I don't want to use a query as the main purpose of using GetItemById is performance. ...
0
votes
2answers
178 views

How to update one list from another, element by element

I want to update some changes in one list from another. The second list should have details of first list. First list has got elements: Contract | Worker | Day Start | Day Stop | ...
0
votes
2answers
35 views

Deleting items in object-model

How to add a new item to SharePoint list in server object-model using C#. This is my code and I want to delete just one item using listBox SPWeb web = SPContext.Current.Web; ...
0
votes
1answer
45 views

Possibility of memory leaks in this code block

I have a tool using a similar code block as follows. private void createDiscussions() { SPWeb newCommunitySite = null; try { using (SPSite site = new ...
0
votes
1answer
86 views

Adding items in server object-model

How to add a new item to SharePoint list in server object-model using C#. This is my code and I want to add items using textboxes SPWeb web = SPContext.Current.Web; ...
0
votes
2answers
71 views

Get the title of the item in detailed view (JavaScript)

When I click on an item in a list I get to the detailed view. There I need the title of this item. I could find it in the title of the page (when you look on the tab of your browser) but I think it's ...
2
votes
3answers
2k views

Getting hold of the document sets in a library

I am sure something wrong with the following code. There are over 400 document-sets in the library and script only shows 8. Please suggest which line is messed up. (At one time I could get this work) ...
0
votes
0answers
94 views

Error because of override of owshiddenversion data

I am getting following error in ULS log while updating a PropertyBag value of a listitem in document library. It is being thrown from source - sharepoint foundation. I am using SharePoint 2010. Did ...
0
votes
1answer
30 views

Applying Layout to Default Homepage Using Object Model

I've This Code to Add Page from Page Layout using (SPSite site = new SPSite(w.Url)) { using (SPWeb web = site.OpenWeb()) { PublishingSite pSite = new ...
1
vote
1answer
39 views

item[“Created By”] - How can I just get the name of the user without their ID?

I'm retreiving a series of details from an item using the following (cut down to only include Created By to make this easier to read): public List<FacilitiesEntity> FetchItems(string siteName, ...
0
votes
2answers
3k views

Getting SPUser object from “Group or People” SPListItem field

I am using a Powershell and CAML query to return items from a list. The list contains a "Group or People" field in which I have not seeing how to get the email and login information of the user. I ...
0
votes
1answer
64 views

Retrieving All Sub Site with Sharepoint Object Model Error

My code: using System; using System.Web; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.SharePoint.Client; using ...
0
votes
0answers
40 views

showing data in custom asp.net from sharepoint 2013(document libs/lists)

What would be best approach to show docs or list in an asp.net page from SharePoint 2013 on premises? I would like to show documents and lists. Which one is better CSOM,Odata? With document libraries ...
0
votes
0answers
74 views

how to fetch newsfeed from social network

I am creating an AppPart which should fetch Newsfeed from Facebook or twitter or some social network. I tried the following code ClientContext clientContext = new ...
4
votes
4answers
1k views

How to programmatically modify item level permissions prior to first save?

I've got a situation where there are strict permissions requirements on an a list of which I already have written a custom form. The requirement is that upon creation, based on metadata, only certain ...
2
votes
1answer
320 views

Unable to seperate normal and hidden folder such as “Forms” [SPFolder Object Model ]

While performing certain task in a console application, i am unable to separate normal folder and hidden ones such as "Forms","FormServerTemplates" etc. I am using SPFolder in the obejct model. I have ...
2
votes
2answers
1k views

Getting SPList object by Guid giving exception “List…does not exist at site with URL”

I am trying to load a drop down list with the same items that a lookup field uses. I thought it would be relatively straightforward, but the line SPList lookupList = ...
0
votes
0answers
43 views

Cannot update role assignments for Sharepoint\system

I am currently working on an application where-in I would have to programatically copy or move a file within a document library or an attachment to another location which may be within the same site ...
3
votes
2answers
2k views

Programmatically retrieve the MySite URL of user

Let's say that we have the SPUser object of current user - how do I programmatically retrieve his mysite URL path, for example "mydomain:8080/personal/saltarski"? Currently I do it through string ...
10
votes
3answers
30k views

Sharepoint 2010 how to get all items in a folder contained in a list?

I have a list that contains folders. Using c# and object model, how can I see if the folder contains any items, or return a collection of all the items in that folder.
0
votes
4answers
829 views

Accessing LookupFieldValue throws error

I have a lookup field on a list (header) that looks up values on the same list. I am trying to read the value out of that lookup with this code: using (SPSite site = new SPSite (mySite.ID)) { ...
0
votes
1answer
76 views

Using CopyTo() and MoveTo() to copy or move files within the same site collection

I have a Sharepoint deployment with the following hierarchy : http://myserver.com:23456/ - SiteCollection as well as root site. http://myserver.com:23456/Archive - An archive site within the site ...
0
votes
0answers
38 views

Using SPExport to export only the attachments of a list item

I want to copy attachments to a list item such as meeting request as well as annoucements to another Sharepoint site collection by preserving the metadata. Is it possible to use SPExport and SPImport ...
0
votes
0answers
80 views

Copy list item from Prod to Dev using Powershell or Server Object model

I'm looking for the best way, either throught Powershell or the Object Model, to copy a list item from Production to Dev. The lists are identical, I just have one item that is causing an error in an ...
0
votes
0answers
38 views

Need to add a timer job to an existing C# project

Hi I have created a Console project first and its working fine. Now I'm in a need to add a timer job to this project. Can I do that if so please let me know how to do that with steps. I have seen many ...
0
votes
1answer
138 views

SPWeb.GetListItem behavior

I am currently trying to retrive a Sharepoint item given it's URL. The URL would be an absolute URL or a relative URL. To achieve this, I am using the SPWeb.GetListItem(string url) method. I observed ...
19
votes
3answers
2k views

Feature based XML vs. Object Model: Which is better for content type development?

I've been researching a few different ways to create content types and I recently discovered that you can use the Object Model to do this. All of the examples I have found online typically use XML ...
2
votes
4answers
1k views

WCF Service @ SharePoint 2010 TimeOut

I have been developing on SP 2010 for a while now. Mostly I have been working with the Client Object Model. Though I am at a point where I need to read out the UserProfiles from inside SharePoint. ...
0
votes
1answer
2k views

Event SPListItem Recurrence Text?

Is there a way to get the text displayed for the "Recurrence" field on the View Item screen for an OOB "Event" list item through the object model? For example, I see: "Every 1 month(s) on the first ...
0
votes
1answer
242 views

How to understand SharePoint's “All Files” folder structure?

When I open SharePoint Designer, I can usually depend on using the "All Files" tab to find what i need. But I've never really understood what this thing is. I can't seem to find a similar file ...
1
vote
2answers
1k views

How do I obtain the SPWorkflow object in the event receiver?

I have a workflow event receiver which is handling the WorkflowStarted and WorkflowCompleted events. I need to obtain references to the workflow list item and the workflow object to do some additional ...
0
votes
1answer
37 views

Is there a way to use the same method to read both an SPListItem object and SPListItemVersion object

I'm using SP2010 Server with C# for development. I'm currently writing a method that will read a couple of values from each version in a document's history. Ideally I'd like to use the same method ...
0
votes
1answer
880 views

Object Model List all users with full control on a sub site in SharePoint 2013?

If I have a sub site URL and a user with Site Admin, can I list all users in that sub site that have Full Control at that level? Any C# code sample?
1
vote
1answer
28 views

remove column from showing up in document properties

Which property in the object model do I use to tell an SPField not to show up in the document properties in Office integration? I tried ShowInEditForm but that didn't work. i want my Status column to ...
0
votes
2answers
931 views

SharePoint Online: Getting Current User Information

What is the best way to get the current users information. With the UserProfileService unavailable in SharePoint Online what would be the best method for getting a users information. Client was ...
0
votes
1answer
168 views

How do I use the object model to update quota values?

Reading this doc I'm confused by the following paragraph: If you change the values for a quota template, those changes apply only to new site collections to which you apply the template. ...
0
votes
1answer
720 views

Adding column in Status indicator

I have requirement that adding one more field in the Status indicator list view programmetically.is there way to extend the Staus indicator list using programmetically?.How can i acheive this? Any ...
0
votes
0answers
116 views

Query user details using employee ID

Is there a way to fetch user details from user profile service using employee ID?
3
votes
1answer
1k views

Using GetDataTable() hoses my SPFieldLookValueCollection!

I am trying to use GetDataTable on an SPListItemCollection. I have run into a situation where my SPFieldLookupValueCollections in this list are being converted to a string when they are stored in the ...
0
votes
2answers
149 views

Add file to subsite with C# knowing only URL?

I would like to use C# to add a file to a library in a subsite. I believe SPWeb will only reference the site I am on. In an ItemAdded eventreceiver, I want to use something like SPFolder ...
1
vote
3answers
238 views

Can I programatically move sites or content between 2007 and 2010?

Using the SharePoint Object Model on a SharePoint 2007 environment and the remote object model to talk to a SharePoint 2010 environment would it theoretically be possible to migrate sites or content ...
7
votes
2answers
403 views

SharePoint App VS Object Model

For designing solutions I am confused with whole Apps concept in 2013. What is Microsoft's guidance for when to use a SharePoint app and when to go for a traditional client or server object model ...
0
votes
0answers
256 views

TermSetItem.Terms does not load properly?

I am attempting to write a PowerShell script to extract taxonomy entries from one environment to import them into another. I'm running into a problem where one of my Term Sets' Terms property is not ...