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

Question

Question

Retreive document id inside workflow script

asked on December 2, 2014

I am starting a workflow when a new document is placed in a folder. In the workflow script, how do I get the id of the document please or how do I access that document in the workflow script please?

 

Thanks,

Priya

0 0

Replies

replied on December 2, 2014

this.BoundEntryIdID (in C#) gives you the entry ID.

0 0
replied on December 2, 2014

Thanks. In my script, I am logging in to the repository and giving my user name and password in plain text. Is there a way to encypt my password in the workflow script please? Thanks for all your help.

 

Thanks,

Priya

0 0
replied on December 2, 2014

There is not. You should use the SDK script activity so Workflow will make the connection for you using its connection profile.

0 0
replied on December 2, 2014

Ok.  I am using the SDK script and I use below code to connect to repository. How do I use the connection profile please to make the connection?

 

RepositoryRegistration myRepoReg = new RepositoryRegistration("<server name>", "<repository name>");
            Session mySess = new Session();
            mySess.IsSecure = true;
            mySess.LogIn("<username>", "<password>", myRepoReg);

0 0
replied on December 2, 2014

When I use this in SDK script, I get an error "Could not connect to Laserfiche Server".

 

DocumentInfo document = Document.GetDocumentInfo(docid, RASession);

 

0 0
replied on December 2, 2014

You don't need any of that code. Just use RASession whenever you need to specify a connection in your other calls.

For ex, the code below would create a shortcut to your document:

Shortcut.Create("\\Shortcut to Doc", this.BoundEntryId, EntryNameOption.AutoRename, RASession);

 

0 0
replied on December 2, 2014

Ok. But I get an error "Could not connect to Laserfiche Server" when I try to get the documentinfo please.

 

Priya

0 0
replied on December 2, 2014

Does your workflow have a connection profile?

0 0
replied on December 2, 2014

Yes, it has a connection profile and I get the same error when I use the below code: "Could not connect to Laserfiche Server"

 DocumentInfo document = Document.GetDocumentInfo(this.BoundEntryId, this.RASession);

 

0 0
replied on December 2, 2014

Is there anything else I am missing please?

0 0
replied on December 2, 2014

Just to make sure, this is Workflow 9.2, right? Are you sure you're using an SDK Script activity and not a plain Script? Your code works for me.

0 0
replied on December 2, 2014

It is workflow 9.1. yes, I am using SDK Script. I can export the workflow and send for your review if you would like.

0 0
replied on December 2, 2014

WF 9.1  works the same way as 9.2. It's probably best that you attach your workflow to a support case rather than this site.

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

Sign in to reply to this post.