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
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
this.BoundEntryIdID (in C#) gives you the entry ID.
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
There is not. You should use the SDK script activity so Workflow will make the connection for you using its connection profile.
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);
When I use this in SDK script, I get an error "Could not connect to Laserfiche Server".
DocumentInfo document = Document.GetDocumentInfo(docid, RASession);
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);
Ok. But I get an error "Could not connect to Laserfiche Server" when I try to get the documentinfo please.
Priya
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);
Is there anything else I am missing please?
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.
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.
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.