0
votes
2answers
60 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
1answer
46 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 ...
1
vote
0answers
48 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
226 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 ...
0
votes
1answer
135 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 ...
0
votes
2answers
137 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
67 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 ...
0
votes
1answer
84 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 ...
1
vote
3answers
120 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
52 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 ...
3
votes
1answer
82 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
53 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 ...
0
votes
2answers
188 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
36 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 ...
1
vote
0answers
66 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 ...
0
votes
2answers
552 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)) { ...
3
votes
1answer
6k 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 ...
1
vote
1answer
305 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
0answers
201 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 ...
2
votes
2answers
1k 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 ...
0
votes
1answer
574 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 ...
1
vote
1answer
164 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
2answers
901 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
1k 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?
2
votes
1answer
260 views

SharePoint object model

I'm looking for articles on custom model mapping for Sharepoint (2007 / 2010). Google's not returning a lot of hits on this, are the any articles out there? Best practices, mapping and such? I'm ...
1
vote
2answers
330 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 ...
3
votes
3answers
6k views

Sharepoint 2010: Custom “New Item” form - showing ribbon and binding events to ribbon buttons

We've created a custom New Item page for our list on our site in Sharepoint 2010 with this code: <asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server"> <table ...