API for interacting with SharePoint from .NET code deployed to the server.
0
votes
2answers
25 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
14 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
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
17 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
0answers
32 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() ...
2
votes
1answer
501 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...?
1
vote
1answer
616 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
51 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
34 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 ...
1
vote
1answer
296 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 ...
1
vote
1answer
586 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
1answer
43 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
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 ...
1
vote
2answers
805 views
Server timeout issue when getting 500000 records from SharePoint 2010 list
I am working on Sharepoint 2010. I want to get 500000 list items from the "Announcement" list. I got server timeout issue and the code is given below
SPList list = web.Lists["Announcements"];
SPQuery ...
2
votes
3answers
11k 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.
6
votes
5answers
5k 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 ...
0
votes
0answers
80 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
1
vote
1answer
179 views
SPWeb.Webs, foreach and var
See below:
SPWeb currentWeb = SPContext.Current.Web;
foreach (var web in currentWeb.Webs)
{
// web is object here - why?
}
SPWebCollection implements IEnumerable<SPWeb> (among other ...
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
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
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
107 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
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
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 ...
1
vote
1answer
145 views
To deploy page layout with feature at the same time of adding content type, the content type Id issue
First let me describe my situation:
Now I'm using object model to add two content types (inheriting Pages content type) using the FeatureActivating methode in the Feature Receiver. in the same ...
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.
...
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 ...
4
votes
1answer
3k views
Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack
this code thow an exception at "Item.Update();"
private void AddEmail()
{
site = SPContext.Current.Site;
web = site.RootWeb;
...
1
vote
0answers
44 views
Distinguish Event Receiver Firing From Web UI or From Code
Think of some event receiver methods like ItemAdded, ItemDeleted etc.
How can I detect in my event receiver code if the item adding/deleting is being triggered from the web UI or from the object ...
1
vote
1answer
89 views
Stale QuickLaunch after SPWeb.Title update and Redirect
Thanks for taking a look.
I have a text box and a button on a SharePoint aspx page which will update the current SPWeb's title. The control then redirects the user to a different .aspx page in the ...
1
vote
2answers
113 views
SharePoint Data Modelling Tool
I plan to develop a data model for a SharePoint application that we would like to bid out for development. Is there a data modelling tool that is preferred to be used with SharePoint, like it can ...
0
votes
2answers
154 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
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, ...
1
vote
3answers
46 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 made on it?
Example:
public void TheCallingFunction()
{
SPSite site = ...
0
votes
2answers
100 views
How check if a site (not site collection) has sub sites in it? [Object Model]
I am trying to figure out a way to check if a Site inside a Site Collection has sub sites in it.
To get sites inside a site collection, we can use the below code.
foreach (SPWeb siteobject in ...
1
vote
1answer
34 views
Move discussion list to another discussion list
How to move a discussion list with all its messages to another discussion list maintaining the proper tree structure of the messages(replies)??
1
vote
0answers
72 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 ...
0
votes
1answer
177 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 ...
2
votes
1answer
2k views
How to update a deployed content-type?
I created a content-type and applied it inside a document library. Now, if I go to the conent-type gallery and delete one of the fields, and then go back to the library and view the available ...
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
115 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
3answers
138 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 ...
16
votes
3answers
912 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 ...
0
votes
0answers
178 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
454 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
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 | ...
1
vote
2answers
2k views
Scope in your query does not exist
I'm developing a web part (in VS 2010 for SharePoint 2010) to seach all content in a Publishing Site Collection. I have the following code (just testing before I change the scope and the select ...
2
votes
1answer
70 views
Deleting a SharePoint User Profile remotely
Can anyone tell me how to delete a SharePoint user profile remotely? I don't see a way to do this using SharePoint Web Services or User Profile Services. The following code works fine when run on ...


