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

Question

Question

c# workflow to move Document from laserfiche repository to another directory

asked on October 16, 2018 Show version history

Hi all,

I'm trying to move a document from the laserfiche repository to a specified directory, and if the document already exists in the target path replace it. I'm struggling with the source path part, i get the error posted below when I try to run my code.

 

more information

* C#

* Script

*Workflow

 

0 0

Replies

replied on October 16, 2018

Workflow is a service that runs as a specific identity (often times Local System).

The User folders typically have restricted rights and so are not a good place to have a service work in.  You can either use a location like C:\Temp or you can find out who the Workflow Service runs as and give that user rights to your user folder.

0 0
replied on October 16, 2018

Thanks Warren for the response ,

But unfortunatley I don't think thats the problem with my code, the code was supposed to log in to the repository, search for document specified and then move it to the target path.

so I dont know why the code searches outside the repository like it doesnt stay in the repository and search there as directed by my repository access.  I dont know if im making sense.

 

0 0
replied on October 16, 2018

You are correct that your code is incorrect (I had not even looked at the code... just saw the error message)

Take a look at sdk export to see an example of how to export from Laserfiche using a SDKScript activity in Workflow.

But the information I gave you about using the Windows User folders still holds true.  You should avoid using them as working folders for services.

2 0
replied on October 17, 2018

Hi Warren,

The code you are referring me to I once tried it and i had an error with the "BoundEntryInfo" hence I tried the one I normally would use with the visual studio, Note: I'm using normal script not SDK Script.

0 0
replied on October 17, 2018

Since you want to do things in the repository (export a document), you need to use a SDK script because it has some built in things (like the connection to the repository and the BoundEntry objects) that make things easier for you.

 

Basically, to Export a document from the repository you need a connection to the Repository and a DocumentExporter.  The SDKScript has a built in connection to the repository using the same connection that the workflow does.  To get access to the DocumentExporter, you must add add a reference to Laserfiche.DocumentServices.

Once the reference is added, you also need to add the "using" statement.

 

You only want to use the BoundEntry object if you are trying to access the entry that is set as the "Scripts Default Entry".

0 0
replied on October 17, 2018

Thank You very much Bert smiley 

It is working absolutely fine now.

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

Sign in to reply to this post.