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

learn more… | top users | synonyms

0
votes
4answers
652 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
19 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
6 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
15 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
6 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
27 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 ...
1
vote
1answer
1k 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) ...
18
votes
3answers
1k 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
1k 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
63 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
992 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 ...
2
votes
1answer
951 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 ...
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
242 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
18 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
428 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
63 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
615 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
64 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
782 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
68 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
153 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 ...
6
votes
2answers
219 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
148 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
40 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 = ...
2
votes
3answers
96 views

To Dispose or Not to Dispose - IDisposable Passed as Function Parameter

If an IDisposable SharePoint object is passed into a function, does an explicit Dispose() call need to be made on it? Example: public void TheCallingFunction() { SPSite site = ...
0
votes
3answers
1k 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
29 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
228 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 ...
3
votes
3answers
1k views

How to create InfoPath forms dynamically?

I have an InfoPath form published to a library... I need to create forms dynamically with siteuser as form name... I need to achieve it in Object Model... Can any of you help me on this...?
2
votes
3answers
3k 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" + "/" ...
11
votes
4answers
6k views

How to automate entry of external column data in BCS?

I have a document library, Resumes, that has a large number of resumes in it. There is a regular column on that library, called EmployeeID, that is already populated. I have an external content type ...
1
vote
1answer
119 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
58 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
87 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
262 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
57 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
313 views

Is there a way to only clear a specific item from the recycle bin?

I know I can empty the recycle bin for a site collection with the following: public static bool EmptyRecycleBin(string siteCollection) { try { using ...
3
votes
2answers
1k 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 ...
2
votes
1answer
341 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 ...
1
vote
1answer
414 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
2answers
2k views

Adding Document to a record library programmatically

I have a requirement, where I need to upload a document like invoice report to a record library programatic. I have used the same code as uploading document to a normal document library. Now the ...
2
votes
1answer
540 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
119 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
224 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
176 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
175 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 ...
0
votes
3answers
94 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 ...
1
vote
0answers
204 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 ...