Create Document using IManage

Hello all,

I am using the following code to create and check-in a document. It's working fine in few environments but it's throwing flat space error in another environment. Later I got to know that it's a new configuration introduced in 8.5.

 

var folder = GetFolderById(Session, folderId);
var document = folder.Database.CreateDocument();
// Set document attributes such as Author, clas and type.
document.CheckIn(filePath, imCheckinDisposition.imCheckinNewDocument,
imCheckinOptions.imDontKeepCheckedOut, ref iErrs);
var folderContent = (IManDocuments)folder.Contents;
var retDoc = (IManDocument)folderContent.AddDocumentReference(document);
document.Refile(folder.Database.CreateBlankProfile(), folder.Workspace.Security);
folderContent.Refresh();
folder.Update();

 

Above code is throwing error when document.CheckIn is invoked.

 

Any help would be appreciated.

 

Thanks.

Comments

  • If flat space filing is turned off, you have to use checkintofolderasnewdocumentwithresults (on the imanage.imandocument3 object): the document has to be added to a folder from the start.

TeamSite Developer Resources

  • Docker Automation

  • LiveSite Content Services (LSCS) REST API

  • Single Page Application (SPA) Modules

  • TeamSite Add-ons

If you are interested in gaining full access to the content, you can register for a My Support account here.
image
OpenText CE Products
TeamSite
APIs