API for interacting with SharePoint from .NET code deployed to the server.
0
votes
1answer
480 views
How to create a SPUser object from its XML representation
I have the following XML representation for a user:
<pc:Person xmlns:pc="http://schemas.microsoft.com/office/infopath/2007/PartnerControls">
<pc:DisplayName>John ...
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
18 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?
0
votes
2answers
18 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
19 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
2answers
83 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 ...
0
votes
1answer
24 views
Approving document library items from Object model in WSS 2.0
What is the correct way to approve an item in WSS 2.0 through the object model? I have some code that was recently modified to auto approve items that met certain criteria by another developer. That ...
0
votes
1answer
25 views
Longest practical filter for an alert
Environment: SP2010 Enterprise SP1, Server/SQL 2008 R2, VS2012
When building alerts through object model, what is the longest or most complex CAML filter that can be applied to them? Can they be as ...
0
votes
1answer
178 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
3answers
139 views
I cant hide the Title field programatically
I am trying to hide the Title field so it does not appear in add/edit forms. I am using web templates. The title is hidden in the sitecollection but not in any of its sub sites.
Below is my code. ...
0
votes
1answer
159 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
1answer
457 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
125 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
138 views
What permissions are required to access SPSite.Usage?
I am using the SPSite.Usage property in the object model to get statistics on the size of a site collection in SharePoint 2010. With my own user account being a farm administrator, site collection ...
0
votes
1answer
922 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
673 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
91 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
2answers
472 views
Changing PublishingPage.Layout doesn't change the content type?
I'm trying to update the Layout of the default.aspx page in my SharePoint publishing site and although the Layout does get updated, the ContentType of the page does not. Anyone have any ideas?
Based ...
0
votes
1answer
437 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
113 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
486 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
149 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
566 views
Programmatically enumerating Web Part Zones of a Publishing Page Layout
I have a situation where a class I have is passed a PublishingPage instance and I want to enumerate any and all web part zones that are used in the Layout Page for this page.
This is proving tough.
...
0
votes
1answer
425 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
821 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
193 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
3answers
793 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
2answers
27 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
15 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
0answers
33 views
SPWeb.GetFolder() returns SPFolder with no files or sub folders
I'm encountering a strange problem on SharePoint 2007 where the following script correctly enumerates files and folders on my QA and DEV sites, but not on my Production site. Why is SPWeb.GetFolder() ...
0
votes
1answer
45 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
81 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
50 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
0answers
108 views
Use picture name from picture library as lookup field
I have a picture library that I want to use the name as the source of a lookup. You cannot do this with the Name field. So, I created a new field, Picture Name. I am trying to wire up an ItemReceiver ...
0
votes
1answer
70 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
189 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
71 views
SharePoint 2010 Workflow with a set of documents
I'm creating a workflow that starts with a user filling a form. The form contains a number of fields like first name, last name, a choice field with say choices A, B and C.
Depending on the choice, ...
0
votes
0answers
184 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
2answers
117 views
how to open version history using SPSecurityTrimmedControl
I am using SPSecurityTrimmedControl to view version history of list for users who have more than read permissions like this
<.SharePoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl1" ...
0
votes
0answers
180 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
2answers
130 views
How to update one list from another, element by element
I want update with some changes one list from another. The secand list should have details of first list.
First list has got elements:
Contract | Worker | Day Start | Day Stop | ...
0
votes
1answer
225 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
130 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
2answers
2k views
How to add specific SharePoint Group to List permission with c#?
using (SPSite site = (SPSite)properties.Feature.Parent)
{
using (SPWeb web = site.OpenWeb())
{
if (web != null)
{
web.AllowUnsafeUpdates = true;
SPList list = ...
0
votes
1answer
42 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
46 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
375 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
86 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
0answers
632 views
Ho do I populate a TreeView with data from the TermStore?
How do I bind termstore to treeview webpart? I want to show my term store in a webpart. I was using the code below but its giving away all the groups but I want the one which I have selected only.
...
