.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
Imran Ghani
Post New Web Links

adding folders to a library

Posted By:      Posted Date: September 21, 2010    Points: 0   Category :SharePoint
 

I'm creating document structure whenever a document is added. Within business rules is stated that document will be added only in the 5th folder in the sturcture. So if the list name is ProjectDocuments the stucture would be

ProjectDocuments/folder1/folder2/folder3/folder4/folder5/filenaem.doc

The issue is that in the custom workflow that i created only 3 folders can be added. When 4th is added SP throws an exception. Is there a setting somwhare that changes this or this is a bug?

Just to note using SP UI user can add many folders one within another.

body of the method :

private void addFolderToSubfoldersCollection(ref string folderName,SPFolderCollection subFoldersCollection )
        {
            bool folderExists = false;
            folderName = makeNameFormated(folderName);
            foreach (SPFolder folder in subFoldersCollection)
            {
                if (folder.Name == folderName)
             &nbs


View Complete Post


More Related Resource Links

Enterprize library 4.1 getting output parameter after adding record in db, plz guide

  

Hi,

I need to get output parameter (flag) from db after saving record in database. I am using Microsoft Enterprise Library 4.1 for DB. I am inserting record using I Data reader.

Please guide

Thanks


Error adding a document library to a site

  

Hi,

I am receiving the error "Cannot complete this action.  Please try again"  when trying to add a document library to one of the sites.  This is Sharepoint 2007 SP1.  I seem to be able to do it thru designer but not the web interface.

Does anyone know how to fix this?


Sharepoint slide library adding functionality.

  
The slide library in Sharepoint allows you to upload Powerpoint slides to it, then to copy a slide to a new presentation and edit it, or check it out so you can edit it and check back in the changes. Unfortunately the ability to check out multiple slides at once to edit is not possible, only the ability to copy them to a new presentation, so you lose all data stored with them.  I am trying to find a way to be able to check out multiple slides at once, then be able to check them in when you have made changes.   My questions are basically:  Can I add a button to the Sharepoint slide library interface? How can I interact with the client machine in terms of opening Powerpoint and getting them to be able to check out the slides? I have the Sharepoint VSTO tools installed and this must be for Sharepoint 2007. Thanks  

Column Autonumbering in Doc Library: different numbers in different folders

  
Hi All, I am trying to develop an automunbeing column following the following post: http://social.msdn.microsoft.com/forums/en-US/sharepointdevelopment/thread/867bcacd-d378-411a-849a-fc040de9e5da/ This looks great, but unfortunately I have to develop something more specific. I have a doc library with specific folders and subfolders. I need to have an autonumbering code for each folder and subfolder. for example, given the following doc library structure: Doc Librery     - 01 Engineering     - 02 Design     - 03 Procurement         - 01 Onshore         - 02 Offshore each document should have the following autonumbering: in 01 - Engineering   -> 01ENG-0001, 01ENG-0002, 01ENG-0003 etc. in 02 - Design   -> 02DES-0001, 02DES-0002, 02DES-0003 etc. in 03 - Procurement -01 Onshore   -> 03PRO01ONS-0001, 03PRO01ONS-0002, 03PRO01ONS-0003 etc. in 03 - Procurement -02 Offshore   -> 03PRO02OFF-0001, 03PRO02OFF-0002, 03PRO02OFF-0003 etc. in this way I can easy identify where the document is stored. how can I do this? a custom workflow or a custom field developed in Visual Studio? Any suggestion would be good. Thanks Vit  

Listing documents in Folders and subfolders in a Dataview of Document Library

  
My dataview is pointed to a Document Library. I noitced files in folders and subfolders don't list - only the folders themselves.  Is there any way to list files in a particular folder or all files in all folders? What I'm trying to do is tie a folder to entries in a custom list. I'd like a folder for every ID in that custom list. When I open the Dispform for the ID, I'd like a dataview or some other webpart to dynamically to show related files (all which would ofcourse just be in their respective folder). I'm thinking it's just a matter of passing the ID querystring to a condition in the Dataview or Webpart. It would also have to be a folder as I need to allow same file names to be uploaded.   Thanks.  

VS2010 has stopped working error adding new item to folders in MVC2

  

 Hello,

   I am using VS2010 Pro in 64 bit Windows 7. When I add a new item to a folder in an ASP.NET MVC2 project, VS frequently crashes with a "Visual Studio has stopped working" error and then closes down. If I re-open the project the item is not visible in the MVC project folder, (but it is visible to windows explorer although I think it's corrupted). If I then try to add the item again, it warns me that it already exists and asks to overwrite, choosing yes to overwrite usually works OK.  When adding an .edmx item it is more problematic, I can't overwrite it but because I know that there actually is a file in the folder, (although not visible and albeit corrupted), I can add it as an existing item and then choose "update model from database" to get it to work. This error is happening more and more frequently.


I want to upload Folders which contain special characters into the sharepoint document library

  
I want to upload Folders which contain special characters into the sharepoint document library

Adding multiple users to a document library column by web service

  

I'm attempting to create some VB code to call a SharePoint Web Service to add a document and associated metadata to a document library. I can successfully add metadata to a text column but I'm having some problems getting multiple entries into a column which is specified to take multiple users (and does so when they are added manually) although I can get a single user in using the following snippet.

Dim info2 As MySharePoint.FieldInformation = New MySharePoint.FieldInformation()
info2.DisplayName = "Authors"
info2.InternalName = "Authors"
info2.Type = MySharePoint.FieldType.User
info2.Value = "1"

I'm hoping that someone will be able to advise me of the approach or syntax necessary to add multiple users to this Authors column e.g. Users 1 and 74. I note that

info2.Value = "1,74" or info2.Value = "1;74"

don't appear to work.


Adding folders to the List Template Gallery

  

The List Template Gallery in its initial form does not allow the user to add folders.

How would I go about modifying the List Template Gallery to allow folders to be created for organizing the list templates?

 

I tried looking in the 12\TEMPLATE\FEATURES for an item that matched the List Template Gallery but did not find one there.

 

Any ideas on where to look for this?

 


Adding a reference to Microsoft excel object library

  

Its my first website with Visual studio 2005 and one of the things I used t do in VS2003 was to add the reference to Microsoft excel object library.

but the reference will not add, it does not give any error just goes back to the ide with no reference in the bin folder.

has anyone seen this or know what it is?


Determine permissions for a document library with nested folders

  

I have a document library with many nested folders.  Each folder has unique permissions.  Is there a way to get a report of all permissions assigned to this document libary/folders? 


query to get Items from sub folders in a document library

  

Hi

 

i am having a document library  MY LIBRARY with SUB Folders SUB 1, SUB 2,SUB 3 ,SUB 4

 

i need to retreive documents in SUB 1, SUB 2 only

How can i write CAML query for this?

If need to retreive from one sub folder, i am using

 

qry.Folder = list.ParentWeb.GetFolder("MY LIBRARY /SUB 1");

 

Thanks and Regards,

Vinnu

 

 


Document Library View - "Folders or Flat --> Show all items without folders" setting not being saved

  

A view of a document library has a setting under Folders area if the files should be shown in their respective folder or just a flat list of file. If "Show all items withtout folders" is selected, following is my observation:

- Saving the document library as a template and creating new libraries from this template takes this setting into the new library as expected
- Saving the site as a template and creating a new site from template removes this setting from the existing document libraries in newly created sites. If a new document library is created from the document library template, the setting is ON as expected.

This seems to be related to what being discussed here http://stackoverflow.com/questions/3574095/hiding-folder-structure-for-a-view-in-sharepoint-2010-list-definition and http://social.technet.microsoft.com/Forums/en-US/sharepoint2010programming/thread/05e46fc9-cb26-4d00-aaf0-e4b6ee944104

Any feedback?


How to view pictures in folders using Picture Library Slideshow Viewer Web Part

  
I have a picture library with folders in it. When I use the Picture Library Slideshow Viewer Web Part, it does not show pictures that are in folders. Is there a way around this? I would really like to have just a couple folders with about 10 pictures in each that I can view. Any ideas?

Adding XsltListViewWebPart on page / context menu issue in folders / SP2010

  

Hi,


I have an issue with adding XsltListViewWebPart on a page for Document Library. When I do it using code below everything works fine unless I create some folder and upload a document there. Such documents have corrupted context menu.

When trying to open a menu I get javascript error:
"This item is no longer available.  It may have been deleted by another user.  Click 'OK' to refresh the page."

When I use ListViewWebPart instead of XsltListViewWebPart everything is ok (but this solution is not acceptable).

Code I use:

using (var site = new SPSite("http://moss_server/ct4"))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    SPFile page = web.RootFolder.Files["Defaul

Adding XsltListViewWebPart on page / context menu issue in folders / SP2010

  
Hi,


I have an issue with adding XsltListViewWebPart on a page for Document Library. When I do it using code below everything works fine unless I create some folder and upload a document there. Such documents have corrupted context menu.

When trying to open a menu I get javascript error:
"This item is no longer available.  It may have been deleted by another user.  Click 'OK' to refresh the page."

When I use ListViewWebPart instead of XsltListViewWebPart everything is ok (but this solution is not acceptable).

Code I use:

using (var site = new SPSite("http://moss_server/ct4"))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    SPFile page = web.RootFolder.Files["Default.aspx"

Adding New Custom Folder Content Type doesn't show up on the Document Library New Menu

  

I been trying to add new custom folder content type to the document library programatically in my sandbox environment and it does show up on the document library. But, when I move same code to the almost similar configured SP2010 environment, adding new folder content type to the document library doesn't show up on the document library's new menu.

Here is the code? Since this code works fine in my sandbox environment, is there any other settings I should check on the server environment which would cause hiding content type on new menu of document library.

  class Program
  {
    static void Main(string[] args)
    {
      SPSite spSite = new SPSite("http://sp2010vm");
      foreach (SPWeb spWeb in spSite.AllWebs)
      {
        spWeb.AllowUnsafeUpdates = true;

        //For each site, cycle through lists
        bool isDocLibraryExists = false;
	      foreach(SPList spList in spWeb.Lists)
	      {
          if(spList.Title == "Classified Documents")
		      {
             isDocLibraryExists = true; 
          }
        }
      
        if(isDocLibraryExists == true)
        {
          //Create new doc library
          SPList splist = spWeb.Lists["Classified Documents"];

          //Create Content Type
          SPContentType documentContentType = spWeb.AvailableContentTypes["Classified Documents Folder"
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend