Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
CreateWorkspace() fails to set projects.subtype
wolfgang
Hello.
I am trying to create a workspace via the IManage API. I am calling the CreateWorkspace() method of the IManDatabase object and setting some
properties like name and description. There are no errors reported or Exceptions thrown. However, the new workspace does not show up in DeskSite.
Compared to a workspace manually created with DeskSite, the only difference seems to be the subtype field of the projects table -- the manually created workspace has 'work' in the subtype field, the other one created with the API has NULL. If I change the subtype value to 'work' in the SQL database, the workspace shows up after a refresh.
What am I missing?
The code I am using follows the manual:
[C#]
// Create the Workspace
// -- db is a valid IManDatabase object
//
IManWorkspace newWorkspace = db.CreateWorkspace();
newWorkspace.SetAttributeByID(imProfileAttributeID.imProfileName, "New Workspace");
string tmpfileName = System.IO.Path.GetTempFileName();
IManProfileUpdateResult result = newWorkspace.UpdateAllWithResult(tmpfileName);
if (result.Succeeded) {
// success
} else {
// no success -- is not reached
}
Regards,
Wolfgang
Find more posts tagged with
Comments
jny
Set the subtype of the workspace to "work" before calling UpdateAllWithResult(), like so:
newWorkspace.SubType = "work";
wolfgang
That works, thank you!
I already had tried setting the subtype with the
.SetAttributeById
method, which didn't work. However, problem solved.
Wolfgang