API for interacting with SharePoint from .NET code deployed to the server.
2
votes
2answers
119 views
Is there any way to find documents with similar titles using FullTextSqlQuery?
Say I have a document with the title, Calendar events for December and another document with the title Month of December Calendar of Events.
Is there some way to determine that these are very similar ...
2
votes
2answers
952 views
Set custom publishing page layout custom field programatically
I have a custom publishing page content type, based on the Publishing Article Page content type. On this content type, I have a custom field named "PageContentCategory". In my code to create new ...
1
vote
5answers
1k views
for vs foreach when iterating over SPWebCollection
I was just wondering which of the two methods below is more popular, when it comes to iterating over a collection of SPWeb objects.
for (int i = 0; i < SPContext.Current.Site.AllWebs.Count; i++)
{
...
1
vote
3answers
3k views
How to convert string into SPUser?
I have a string "System Account", how can I convert the string into SPUser?
I've tried SPContext.Current.Web.EnsureUser("System Account") and also web.AllUser["System Account"] but hit error.
Please ...
1
vote
2answers
2k views
Performance of Client Object Model vs. Server Object Model
We are looking to deploy an Intranet using SharePoint Foundation. I am targeting the Client Object Model for this project to avoid Master Page customization and building custom Webparts and leverage ...
1
vote
1answer
1k views
SharePoint 2010 - Change order of User Profile properties
I would like to know how to change the display order of the out of the box user profile properties using sharepoint object model ?
I would like to move OOTB properties into my custom section.
1
vote
2answers
309 views
Updating an SPListItem without knowing SPSite or SPWeb
I'm building a custom web part that is running an SPSiteDataQuery. I will be running this query across all site collections, and displaying the results, together, in 1 web part. Users interacting with ...
1
vote
2answers
32 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
53 views
Checking SharePoint Uptime Remotely
I was wondering how people have gone about programatically checking if SharePoint is still available?
I use the following now to check it, but it relies on the SharePoint object model and must run on ...
1
vote
1answer
62 views
What are the largest and smallest values that can be stored in an SPFieldDateTime?
What it says on the tin, basically! I assumed it's the same as a regular .NET DateTime struct, but whenever I try to store 01-Jan-0001 (smallest DateTime value), I get an error. Can't find it on MSDN ...
1
vote
2answers
68 views
How to determine was site updated or not
How do I determine through API if a Sharepoint site updated or not? We are writing a tool that connects to Sharepoint site and downloads it on the local computer as a model. When someone adds or ...
1
vote
2answers
63 views
How memory intensive is a list of SPItems?
I want to create a list which can store SPItems for "offline" reference.
I would hope no more than 3000-6000 items.
Do you think this is pushing it memory wise?
Thanks in advance
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 ...
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 = ...
1
vote
2answers
82 views
How to create sites taking values from database
In one interview, interviewer asked this question.
I have one table in sql server database which contains the Title and its id(int).
Now I want to retrieve those values from database and based on the ...
1
vote
1answer
228 views
Dispose issue when working with content types
I am seeing an issue with un-disposed SPRequest objects in the ULS logs when i work with content types in the object model.
My code is as follows (in previous methods run as part of this request, the ...
1
vote
2answers
534 views
Programmatically reading static links in the navigation
I'm having a SharePoint site where I disabled the "show pages" option in the navigation, and created my navigation using the add static heading/link option. My problem now is that I tried to ...
1
vote
1answer
184 views
SPDocumentLibrary.CheckedOutFiles does not return all files
I am working through some code samples on MSDN that is suppose to return Checked Out files but my tests is showing a problem.
Here you can see that both "default" and "foo" in my Page library are ...
1
vote
2answers
874 views
TaxonomyField.SetFieldValue throws “Specified method is not supported” Exception
I'm trying to copy a list item from one list to another. The lists are on the same site and the code is being fired inside of an item added/updated event receiver).
Both lists have managed metadata ...
1
vote
2answers
799 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 ...
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 ...
1
vote
2answers
1k views
Why httpcontext.current is null in sharepoint 2010 while Implementing the Custom Membership Provider?
SharePoint 2007 we can able to use the Httpcontext.current object But in SharePoint 2010 we are unable to get the httpcontext.current object. It will return the values.
How can i get the or Create ...
1
vote
1answer
119 views
What are “unsafe updates” for list items?
In the SharePoint 2010 server-side object model the SPWeb Class has a property "AllowUnsafeUpdates". What are unsafe updates in connection to list item changes? How are they to be delt with in code?
...
1
vote
1answer
781 views
How to programmatically read the contents of InfoPath form?
I have form with data in repeating table. I need to use the object model to read the contents and display it on a webpart. Is it possible? Can any of you help me?
1
vote
1answer
554 views
Retrieving the values from the list view SharePoint 2010 using object model
I have a list (tick_gen) which has a view called "tick_dView" this view just has one row. How can I fetch the value of "Tick_id" column using SharePoint object model?
1
vote
1answer
342 views
Use of SPRequest class in SharePoint Object Model
Can any one explain what exactly does SPRequest class do and for what function we must use it?
Thanks in advance.
1
vote
2answers
267 views
Powershell calling custom code has SPWeb.CurrentUser = null (in certain cases)
I have a custom assembly which contains code to setup Variations for a SharePoint 2010 Publishing site. This code is based off a blog post from Waldek
I have a PowerShell script in which I create a ...
1
vote
1answer
872 views
Getting SPList object by Guid giving exception “List…does not exist at site with URL”
I am trying to load a drop down list with the same items that a lookup field uses. I thought it would be relatively straightforward, but the line
SPList lookupList = ...
1
vote
1answer
535 views
Custom ECB dropdown menu API?
In 2010 (or 2007) is there a server control that is responsible for rendering of ECB menus? For example, if I wanted to create a custom UI for a Document Library (NOT using XSL/DataViewWebPart/etc), ...
1
vote
2answers
1k views
Can I export a SharePoint 2007 list to an Excel file subdivided into separate worksheets?
We have a SharePoint 2007 deployment which will have a substantially large document library. My client wants the ability to export this library to an Excel spreadsheet, but specifically wants the ...
1
vote
1answer
142 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 ...
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
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 ...
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
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
69 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 ...
1
vote
1answer
498 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 ...
1
vote
1answer
217 views
Show Last Viewed date in a View
I understand enabling Auditing at a Content Type or Document Library level allows you to run reports to determine when documents are opened or downloaded (last viewed). Is there a way to show this ...
1
vote
1answer
608 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 ...
1
vote
1answer
293 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
581 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)
...
1
vote
1answer
342 views
Why are SP objects (such as SPUser) not serializable?
I tried to create some private variables that were SPUser's, but I was given an error to the tune of 'SPUser is not marked as Serializable'.
Why?
I know these objects contain a lot of contextual ...
1
vote
3answers
521 views
Accessed denied when attempting to permission folder using the Object Model API
I'm attempting to permission a folder using the Object Model API that is created by an ASP.NET page wrapped into a feature. I am able to create and permission the folder for users that are in the ...
0
votes
2answers
225 views
Event reciever (itemadded) sharepoint 2010
is there a way where we can get the link(editform.aspx) of item just added to the list-- in the itemadded method of the event receiver (Share Point object model)
0
votes
1answer
102 views
How do I read pagecolumns from the current page
I know that I have to use
SPSite site = new SPSite("SPsite Path");
SPWeb web = site.OpenWeb();
SPList contacts = web.Lists["Listname"];
if I need to get content of a List, but how do I read data ...
0
votes
3answers
353 views
How to find newly added item in the sharepoint portal?
How to find the recently added item in the share point page
If the any user added the items in the custom list, library, list,Announcement, Picture library,etc.........
i need to show all item that ...
0
votes
2answers
152 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
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 ...
0
votes
1answer
92 views
PowerShell version of SPWebapplication.FormDigestSettings.Enabled?
Does some one know the PowerShell equivalent version of the following SharePoint object model code:
SPWebapplication.FormDigestSettings.Enabled = false;
0
votes
1answer
917 views
Getting SPUser object from “Group or People” SPListItem field
I am using a Powershell and CAML query to return items from a list. The list contains a "Group or People" field in which I have not seeing how to get the email and login information of the user. I ...