I am looking for some help on a script I wrote that exports a file to a folder outside of Laserfiche. The goal here is to take an electronic file (.txt) and export it to a folder location.
Here is my code:
namespace WorkflowActivity.Scripting.SDKScript { using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Data.SqlClient; using System.Text; using Laserfiche.RepositoryAccess; using System.IO; using Laserfiche.DocumentServices; /// <summary> /// Provides one or more methods that can be run when the workflow scripting activity is performed. /// </summary> public class Script1 : ScriptClass90 { protected override void Execute() { RepositoryRegistration myRepoReg = new RepositoryRegistration("myServer", "myRepository"); Session mySess = new Session(); mySess.LogIn("wfuser", "myPassword", myRepoReg); //uses Laserfiche authentication int curEntry = GetTokenValue("Entry ID"); DocumentInfo DI = Document.GetDocumentInfo(curEntry, mySess); DocumentExporter DE = new DocumentExporter(); DE.ExportElecDoc(DI, "//prodlfqf//Attachments//Signed" + DI.Extension); mySess.Close(); } } }
The workflow is returning an error that 'Entry not found [9001]' and I'm not sure why it cannot find the entry. I'm starting the workflow with an entry ID and it still returns this message. Note: when I replace 'curEntry' with '1234' the file is exported successfully, but I want it to be more dynamic so it will export whatever file initiated the workflow.
Any help is much appreciated!
Nate