Document Set created programmatically doesn't work properly

Alex Angas
  • Document Set created programmatically doesn't work properly Alex Angas

    I have a document library using a document set content type. I can create a new document set through the UI and it works perfectly.

    I'm now trying to create a document set in this library programmatically and it's not working properly. Here is the code (based on MSDN documentation):

    // Set some properties
    Hashtable properties = new Hashtable();
    properties.Add("UploadComplete", false);
    properties.Add("FilenameCode", code);
    // Create the set
    DocumentSet invoiceSet = DocumentSet.Create(
      list.RootFolder, code, InvoiceSetContentTypeId, properties, true);

    What's not working:

    • icon for the set looks like a folder instead of the document set icon

    • clicking on the document set doesn't show the document set home page, it just behaves like a normal document library

    • running CAML queries shows that both internal fields HTML File Type and ProgId should be SharePoint.DocumentSet but instead they are blank

    • changing a field value on the document set folder doesn't propogate to its contents (although perhaps this is supposed to work differently)

    Anyone know what I'm doing wrong?

  • I deleted the Document content type from the library which resulted in Document Sets only working through the UI.

Related questions and answers
  • if they just created the document (i.e., they clicked the button, the folder didn't exist, and so it creates the folder and copies the new Excel file into it). Sometimes they were working on it earlier and then return and get the above message. Waiting for a while can help, but it doesn't seem like even SharePoint's inactivity timeout always does the trick. And here's the strangest part - while... is causing this behavior? I can change the code to avoid it if I can figure out why it is happening. Is there any way through the SharePoint UI or APIs to "release" the document so that the original

  • , but I'm finding the produced XML is not what this XSL is expecting: element names are not all lowercase (not too difficult to amend the XSL to match up, but curious) the hit highlighting properties...I'm writing some code against the search API in SharePoint 2007, and am seeing some interesting behaviour. I'm using the KeywordQuery 'model' rather than FullTextSqlQuery, since this matches the advanced search form our client wants. I'm using the following code to execute the search - this builds a keyword search query in the same format as the OOTB web parts: ResultTableCollection

  • I'm trying to create folders in a set of custom lists I've created. However, when I try to do this, the New Folder button in the Ribbon is disabled. I read up on the matter; and this lead me to look to enable folder creation in List Settings -> Advance Settings. However, there doesn't seem to be an option to enable folder creation on the page. It shouldn't be a permission related issue; as I created the lists; and I'm also an admin on the farm. I could use a document library; but we will not be uploading documents to the list; so this is more then I need. What are my options, or what am I

  • I am facing problem with document check out in a SharePoint document library. This is the message I am getting: alt text I'm using the out of the box document library. I have logged on as Admin Document is not already checked out I have tried creating a new document library I have tried creating a new site collection UPDATE 1: Check out... problem... When I installed a new web application the problem disappeared... But I still don't know what broke it... UPDATE 3: Any other file types check out fine but docx/xlsx/office related types

  • I'd really like to prepare development environment for Sharepoint 2010. This is what I did: I installed Windows 7 x64 I installed VMWare Workstation Created a VM domain controller based on Windows... Powershell as domain administrator (so I have rights to access domain accounts) I didn't install SQL Server 2008 KB 970315 x64, because I'm running R2 version - as I understand this is SQL Server 2008 SP2..." -AsPlainText -Force) When I run it, I'm prompted for database credentials and I enter mydomain\SPF_DATABASE and password I'm also prompted for farm credentials and I enter mydomain\SPF_ADMIN with password

  • I’m trying to write a Http Handler to generate rss xml (based on the CKS code). I want to be able to get the list/library that the end point of the url is referring to. For example if my Url is: I want to be able to get the pages library of the 'press releases' web. On a side note if I'm going about this in the wrong way please let me know. Update 1 It may be easier for me to show my code (incase of retardation) public void ProcessRequest(HttpContext context) { try { SPList list

  • as expected. When I try to add a new item to the list, the list form only shows the Title field from Item. Now, here's the weird part. If I add a second content type to the list (through the UI), the list form suddenly works correctly. This makes me think there's something wrong with my content type. Here's what I'm working with. Some names have been changed to protect the innocent. <ContentType.... Scoped to Site. Registration: contains a ListTemplate and a ListInstance that just modifies a basic Custom List to enable content types and add my custom content type. Scoped to Web. Here's what's

  • , to have each one as a 'subsite' feels like overkill, but that may just be because I'm not used to the terminology. I would ordinarily just think of them as subsections of a website. The 'Support' section is essentially a set of embedded mini-applications such as issue tracking. As it is more substantial, and is not viewable by anonymous users, it feels like it would warrant being at least...I am developing a company website/portal in SharePoint, and am trying to figure out the best way to organise it into site collections, sites and subsites -- I'm confused by the terminology I think

  • I have a custom list with a custom content type inherited from the Folder content type. When I insert a new item in the list I do it like this: newItem["Name"] = "New Folder"; newItem["Content Type"] = "Package"; newItem.Update(); The item is inserted but I found that its title is something like 51_.000 and if I insert another item the title is 52_.000 and so on. Is there something wrong with this code? If so, how do I insert a folder with the title properly?

Data information