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

learn more… | top users | synonyms

0
votes
0answers
7 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
0answers
21 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 ...
0
votes
1answer
25 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
14 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
29 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
9 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
35 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 ...
0
votes
1answer
92 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 ...
0
votes
1answer
20 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
395 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
20 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
1answer
74 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
0answers
77 views

Query user details using employee ID

Is there a way to fetch user details from user profile service using employee ID?
0
votes
2answers
74 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 ...
6
votes
2answers
276 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
162 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 ...
0
votes
1answer
44 views

problem getting date time

I am using the CSOM in javascript. I have a list which contains 3 text types and 2 date types. When I use: var listEnumerator = this.listItems.getEnumerator(); var collection = ...
0
votes
3answers
2k views

count items in a list javascript CSOM [duplicate]

I am wanting to count the number of items in my list. Using CSOM in javascript I have tried it but my code doesn't work. Where am I going wrong. Here is my code: var clientContext = new ...
0
votes
0answers
32 views

Linking a js file into a blank page in sharepoint then count how many items in a list

I have created a new page on my sharepoint site. I have embedded some html using the embed code <!DOCTYPE html> <html> <body> hello </body> </html> I have a js file ...
0
votes
1answer
297 views

getting data from a list sharepoint object model CSOM javascript

I have a list which I want to get information from using javascript. It doesn't show the list just certain things like how many items in the list. I am completely new to sharepoint so don't have a ...
2
votes
2answers
1k 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 ...
2
votes
3answers
4k views

Get absolute URL to listitem's default display form

I need to have an absolute URL of a listitem's display form - currently I do it the following way: On http://mydomain.com/: item.ParentList.ParentWeb.Url.TrimEnd('/') //"http://mydomain.com" + "/" ...
1
vote
1answer
131 views

PowerShell command to get list of documents where users x and y has permissions?

I would like to get a list of documents where user x and y has permissions. Can someone help me? I would like to do it in either PowerShell or C# code.
1
vote
1answer
83 views

Add attachment to Outlook from SharePoint Library

We have a requirement to send Emails from SharePoint with attachments from Document Library. We have been able to achieve this. But now the requirement is client want to open outlook and add ...
3
votes
2answers
91 views

Getting spuser from multiple types of information

If this sounds confusing it's because I'm al little confused on it myself. Basically I have an application (originally written by someone else but never finished) that needs to perform various actions ...
5
votes
1answer
280 views

How to programatically determine if 2013 running in '14 compatibility mode' (SP 2010)

How can you programmatically determine if a site collection is running in '14 compatibility mode' (so it looks like SharePoint 2010)?
1
vote
0answers
62 views

Files.Add fails for users with Contribute

I am using the object API to upload files. In paticular I am doing this.. SPFile file = list.RootFolder.Files.Add(filename, fileStream, author, author, DateTime.Now, DateTime.Now); The problem is ...
2
votes
1answer
467 views

Difference between GUID and UniqueId

What is the difference between GUID and UniqueId? They are both globally unique ids and from the client side we can see they are not the same: ctx = new SP.ClientContext(); web = ctx.get_web(); list ...
0
votes
2answers
495 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 ...
1
vote
1answer
427 views

Transfer Multiple people picker column's value from one site to another

I have a column of multiple people picker called Likes in 2007 sharepoint site which stores n number of people. Now i want to programmatically transfer it's content to sharepoint 2010 site. Problem ...
2
votes
1answer
627 views

Programmatically get the central administration site SPWeb using server object model

Like in the title - is there a method of getting it without supplying the URL?
0
votes
1answer
142 views

How to create 2 level left navigation with code

I need to create a function which will build 2 level left navigation programmatically. Function should take name/title and url. Can some body show me how to create using SPNavigation or any other SP ...
0
votes
1answer
303 views

Setting permissions on a folder

2010, c# server object model I'm trying to programmatically assign permissions to specific folders in a document library (see my original post here) but I'm hung up on selecting a folder as an ...
3
votes
1answer
225 views

Needed help to build caml Query with multiple <And>

I am getting a query from list view by view.Query i got the following <QUERY> <GroupBy Collapse="TRUE" GroupLimit="100"><FieldRef Name="AlertGrp" /></GroupBy> ...
0
votes
2answers
193 views

2010 - SPFolderCollection not updating with new items

2010 Enterprise, VS2012, c# server-side Here's the situation: I have a method that gets an SPFolderCollection object from a document library. It then loops through the list checking for a specific ...
1
vote
0answers
221 views

Programatically adding All Authenticated Users

I want to give all authenticated users read access to a list (that stores some configuration for a feature). "All Authenticated Users" is a special concept in SharePoint, but the implementation ...
0
votes
3answers
112 views

SPFolderCollection valid index arguments

SharePoint 2010, c# server object model, VS2012 Long story short, I'm trying to fetch a folder of a document library, create a new folder in it from an array of names, then fetch the new folder via ...
3
votes
2answers
1k views

SPList.GetItems(SPList.DefaultView) returns only visible items

WSPList.GetItems(SPList.DefaultView) only returns the number of items set to return in throttling settings on the view. I'm aware that I can increase the item limit for the view, but the users are ...
4
votes
3answers
722 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 ...
0
votes
1answer
99 views

SPQuery AppendOnly field returns null

I have a list with an custom append only field for collecting comments from supervisors. When I query the list using SPQuery I always get null back for the value of the append only field. I have ...
1
vote
3answers
170 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 ...
0
votes
1answer
60 views

ProcessBatchUpdate has no effect

I have an application I am working on that uses an Event receiver to propagate metadata to a document library. I am trying to use SPWeb.ProcessBatchUpdate to copy the metadata back. my code looks like ...
1
vote
1answer
781 views

Programmatically get port 80 Web Application Default URL for Farm?

How would I programmatically get the port 80 Web Application Default URL for the Farm?
3
votes
1answer
90 views

How do i “Refresh” each site collection's permissions?

My network admin have deactivated a lot of users from the Active Directory, and recreated them using the same username but with a different OU, Now the SP 2010 does not recognize these users or their ...
1
vote
2answers
55 views

Track users opening files from the farm?

Our internal auditors have made a request to produce a regular report that shows when users access certain files. With this in mind I was wondering - is there a way in the object model or otherwise ...
0
votes
1answer
253 views

TimerJob editing workflow and web config - Consuming external webservice

I have a list that is attached to a workflow (State machine, VS2010, SP2010). There is an OnWorkflowItemChanged activity that will check if a column of the list has been changed. If it changed, it ...
1
vote
2answers
61 views

Accessing the version on an SPFolder

Within a Document Library with versioning turned on, I noticed that if I create a folder and "View Properties" that there is a "Version: 1.0" that is listed as a property along with "Created By", etc. ...
0
votes
1answer
52 views

Ghostable via Object Model

Is it possible to set a file as Ghostable/GhostableInLibrary via the Server Object Model? I don't see any properties on SPFile that seem to fit the bill. I know you can do this via an XML module, but ...
0
votes
0answers
367 views

How can I programmatically upload video( using video url of external sites ..eg.youtube) into Asset Library in SharePoint 2013 using obejct model?

My question is: How can I programmatically upload video( using video url of external sites ..eg.youtube) into Asset Library in SharePoint 2013 using obejct model? Please advise. Regards Sunny
0
votes
2answers
228 views

Adding extension methods to SharePoint types

Heads up, this is very much a beginner question. My SharePoint experience is primarily with working with SharePoint designer and powershell. I've never touched Visual Studio or anything to use custom ...