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

learn more… | top users | synonyms

0
votes
1answer
295 views

Getting Library contents along with Folder structure [Console application using Object Model]

I am developing a console application which will get all the files in a document library and copy it to a particular location on system. I was successful in retrieving all the files within the ...
0
votes
1answer
274 views

Enable-Feature powershell-command in object model

How to do Enable-SPFeature equievalent in object model. I want to enable some features (lists) in my publishing site in event receiver. For example: Enable-SPFeature announcementslist -url ...
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
1answer
170 views

Invalid URI when trying to empty recycle bin

Based on this question I wrote the following in my class for emptying the recycle bin: public static void EmptyRecycleBinItem(string siteCollection, string originalLocation, string filename) { ...
0
votes
1answer
3k views

Copying items from one list in one site to another in another site?

I have a class that I've been working on to allow me to move items in SharePoint, whilst retaining meta data. The class is as follows: public class Lists { /// <summary> /// ...
0
votes
1answer
1k views

Need Sharepoint like modal pop-up window

I need to show Sharepoint 2010 like pop-up window when clicked on a link in grid view. Once the modal pop-up displayed and user selected the Save button data base should be updated with given values ...
0
votes
1answer
116 views

difference between non-/ shared scopes

can someone point out for me the difference between shared scopes and non-shared scopes? I think one difference is that shared scopes are available in all site-collections, whereas non-shared scopes ...
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
1answer
105 views

Automatically add a folder (document set) by code (generating the name also by code, without the user inputting the name)

I want to know if it’s possible to write en Event Receiver in VB for automating the creation of a document set: the user only click “new document set” and then the code generates the document set with ...
0
votes
1answer
848 views

SharePoint Object Model: how to query ONLY last major version of data from Publishing Page?

I came into a situation where I wanted to use SharePoint Object Model SPSiteDataQuery to query data from Publishing Page. However, I dont want the data query based on the permission on current login ...
0
votes
1answer
129 views

Tagging documents in SharePoint

Can we tag individual SharePoint documents? If so, how can we read the tags of a document using SharePoint object model?
0
votes
1answer
1k views

how can i get Web Analytics database name with Object Model?

First let me say, that all of we doing in sharepoint is base on the object model, so i can go to Central Administration and get my "Web Analytics Service Application" Database Name and Server Name, ...
0
votes
2answers
728 views

Add site column to site content type error

var objWeb = properties.Feature.Parent as SPWeb; Guid webPublishingGuid = new Guid("94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb"); SPFeature feature = null; SPSite site = objWeb.Site; feature = ...
0
votes
1answer
161 views

SharePoint Web Part Gallery details of each web part

When using SPWeb.GetCatalog(SPListTemplateType.WebPartCatalog), it returns an SPList which of course contains a SPListItemCollection of the web parts in the web part gallery. When looping through the ...
0
votes
1answer
562 views

Re-order Content Types for a List in code

Has anyone been able to re-order content types for a list in code? If I'm given a specific content type, I want to make it the default in a list, by re-ordering the SPList.ContentTypes collection and ...
0
votes
1answer
1k views

Add an item with lookup field using object model SP2010?

Can someone please post sample code which shows how to deal with a lookup column during an item insert (using object model). Here is the basic framework for an insert: SPListItem oListItem = ...
0
votes
1answer
261 views

SPListItem IsNew Functionality?

In OOB SharePoint, many of the lists render a "New" graphic when an item is "New". I found this posting which indicates how to determine this from an XSL file: ...
0
votes
2answers
1k views

SPList.GetItems(query) does not return SPListItems where the permissions are not inherited

I'm using the following code: protected void TraverseFolder(SPList list, SPFolder folder) { SPQuery qry = new SPQuery() { Folder = folder }; SPListItemCollection listFolderItems = ...
0
votes
0answers
23 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 ...
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
2answers
72 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 ...
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 ...
0
votes
0answers
95 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
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 ...
0
votes
1answer
78 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
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
0answers
117 views

Query user details using employee ID

Is there a way to fetch user details from user profile service using employee ID?
0
votes
0answers
257 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
52 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
1answer
219 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
118 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 ...
0
votes
1answer
65 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 ...
0
votes
1answer
321 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 ...
0
votes
0answers
504 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
1answer
87 views

Best way of customizing SharePoint List forms

What is the best way of customizing SharePoint List forms(NewForm, Edit form, Display form). Application page - object model Visual web part - object model SharePoint Designer 2010 - ECMA script ...
0
votes
1answer
207 views

where i can find trace for item.systemupdate()

I am working on a project which was initially developed by someone else. few of my list items are getting updated but i am not getting anything in version history. I believe that some schedule job is ...
0
votes
2answers
912 views

powershell - The user does not exist or is not unique

When I try to add user/group using SharePoint OM or Power Shell script I'm getting the following error. In this example S-9-9044-V is an AD Group. The user does not exist or is not unique $web ...
0
votes
0answers
375 views

SPListItemCollection.EnsureListItemsData seems to deadlock

I'm trying out multithreading with the SP2010 Object Model and I've run into some weirdness. My application currently does the following: Opens an SPSite and uses AllWebs.WebsInfo to build a Guid[] ...
0
votes
0answers
535 views

Cannot remove file <x>. Error Code: 16388

I've written a tool top copy/paste/delete files accross site collections and then remove the original version from the recycle bin. The method to copy the files is: public bool ...
0
votes
1answer
403 views

Sandboxed Solution to create a Document Library and enabling manual declartion as record

I need to create a SharePoint Feature, when activated needs to create a Document Library and then enable the manual declaration as record. Following is the code which is working fine in a Console ...
0
votes
0answers
245 views

List item attachments not showing up when accessed through the object model

I've got some list items which have manually attached (through the web interface) files and need to access these files on server-side. Whenever I look at SPListItem.Attachments though, it always shows ...
0
votes
1answer
67 views

What is UpdateListCompleted and why isn't it documented?

I've been messing around with the SharePoint List web service and I came across an event called UpdateListCompleted. I thought this might be of some use for the project I am working on so I ...
0
votes
0answers
63 views

Save MasterPage to file system is not bringing Webpart data

I am saving some masterpages to the file systems in some build scripts to automate the process of building deployment packages. This is what I am using to save the masterpages and layouts: using ...
0
votes
1answer
2k views

GridView control - paging with linq. Where is objectDataSource?

I have visual web part with custom logic which retrieves me strongly typed list (not SPList -> .NET list object) which than I bind to gridview which has paging enabled. That works fine. Problem is: ...
0
votes
1answer
119 views

Proper way to retrieve list data asynchronously?

I have done this in the past using jQuery's ajax function and the SharePoint web services, but I'm curious if it is considered a better practice to use the Javascript Object Model? Also, is it secure ...
0
votes
1answer
259 views

RefinementWebPart - UseDefaultConfiguration property

I'm trying to create a filter dynamically through code, and for that I need to set the property UseDefaultConfiguration to false. However, just this simple thing below causes the webpart to "hang" on ...