You are viewing limited content. For full access, please sign in.

Question

Question

Create Document in Repository

SDK
asked on April 20, 2016 Show version history

I am trying to use SDK script to create document in repository and I use the below code. It always says "Entry not found [9001] error. Any help would be great. Thanks.

 

Document.Create(@"Path","DEFAULT",EntryNameOption.None,RASession);

0 0

Replies

replied on April 20, 2016

What is the path set to? Do all the folders in the path exist?

If you plan on doing other things to this document immediately, like setting pages, you probably want to use DocumentInfo.Create instead so you get a lock on the document. See the "Document Organization" section in the SDK help file for an example.

0 0
replied on April 20, 2016

Thanks

0 0
replied on October 23, 2019 Show version history

For those of you like me that got here and needed more information, this worked for me:

FolderInfo folderInfo = Folder.GetFolderInfo("\\path_to_folder", RASession);
DocumentInfo document = new DocumentInfo(RASession);
document.Create(folderInfo, fileName, EntryNameOption.AutoRename);

I also had originally included my Repository name in the path (which was the reason I was getting the Entry not found [9001] error, but it makes more sense that it has to do with the path when you get that error on the GetFolderInfo line).

For more, see this answer: https://answers.laserfiche.com/questions/49295/Using-RA-to-create-a-document-assign-a-template-and-populate-fields#49329

The code here also works but you need to have a trailing slash for the path name: https://answers.laserfiche.com/questions/77942/Documents-Created-via-SDK-DocumentCreate-are-not-triggering-Entry-Create#repliestomain

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.