Hi Karthik,I think we can do as shown belowfirst search the workspace and then add folders by using if stataement like (if template1)add folders with respect names.IManFolders workspaces = null;IManProfileSearchParameters profileSearch = session.DMS.CreateProfileSearchParameters();IManWorkspaceSearchParameters wksSearch = session.DMS.CreateWorkspaceSearchParameters();wksSearch.Add(imFolderAttributeID.imFolderID, Matter.FolderID.ToString());workspaces = database.SearchWorkspaces(profileSearch, wksSearch); if (workspaces.Count > 0) { workspace = (IManWorkspace)workspaces.ItemByIndex(1); }IManTab tab=workspace.Tabs.Tabs.AddNewTabInheriting("New Tab", "description");IManDocumentFolder oDocFolder = oTab.DocumentFolders.AddNewDocumentFolder("NewDocFolder", "description")' Set location and viewoDocFolder.Location.Order = 1Please also let me know if you need code for searching folders under one workspaceThanksKrishna
Hi Krishna I don't understand the process. Please Explain me and give me the process of writing the code and tell me how to run the code.I am expecting your reply.Thanks
Hi Karthik,Please see complete sample code (this is hard coded)This code is executed by me (succesfully)______________________________________________using System;using System.Collections.Generic;using System.Text;using IManage;using System.IO;namespace createFolder{ class Program { static void Main(string[] args) { IManDMS server = new ManDMSClass(); IManSession session = null; IManDatabases databases = null; IManDatabase database = null; IManWorkspace workspace = null; //Please pass this value dynamically in your code String workspaceName = "Workspcase name in which new folder to be added"; session = server.Sessions.Add("your worksite server"); session.Login("username", "password"); if (session == null) Console.WriteLine("no session"); else Console.WriteLine("Session established"); databases = session.Databases; Console.WriteLine(databases.Count); database = databases.ItemByName("your database name"); Console.WriteLine(database.Name); IManProfileSearchParameters profileSearch = session.DMS.CreateProfileSearchParameters(); IManWorkspaceSearchParameters wksSearch = session.DMS.CreateWorkspaceSearchParameters(); wksSearch.Add(imFolderAttributeID.imFolderName, workspaceName); IManFolders workspaces = database.SearchWorkspaces(profileSearch, wksSearch); if (workspaces.Count > 0) { workspace = (IManWorkspace)workspaces.ItemByIndex(1); } if (workspace != null) { //IManTab tab = workspace.Tabs.AddNewTabInheriting("New Tab", "Description"); //IManDocumentFolder docfolder=tab.DocumentFolders.AddNewDocumentFolder("Test","Testcreation"); //Creates new folder//***********better write in a function********* IManDocumentFolder docfolder = workspace.DocumentFolders.AddNewDocumentFolder("Imp", ""); docfolder.Location.Order=1; } } }}______________________________________________________In above code in if loop (workspace!=null)Just write one if loop likeif(template=="Deafult"){ call the function which i mentioned like //****** in code}so here if you want to add 3 folders, call the function 3 times by passing folder name and description.Please let me know if you need any further help on this.ThanksKrishnaHyderabad, India
Hi Friend, I don't know how to write the code and how to use the code. please guide me to do this please. guide me from the beginning.
Hi Karthik,Can you please send me your mail id so that i can send a document with all screen shots for starting this?ThanksKrishnaHyderabad, India