I have a workflow that attaches a PDF to the workflow, and when I use the move pages tool it works fine combining all the pages together, but it doesn't delete the PDF. How can I have that electronic PDF deleted after the move pages are done? Right now, I have to delete the PDF's myself.
Question
Question
Replies
Patrick,
There is no native workflow activity to delete an electronic document from a document in Laserfiche. You would have to use the SDK Script activity or write a custom workflow activity to make this happen. Here is an SDK Script code snippet that should work;
protected override void Execute() { try { // Make sure the bound entry is a document or throw an error... if (this.BoundEntryInfo.EntryType == EntryType.Document) { // Cast the bound entry as a DocumentInfo... using (DocumentInfo docInfo = (DocumentInfo)this.BoundEntryInfo) { // If the document has an attachment then delete it, otherwise throw an error... if (docInfo.IsElectronicDocument) { docInfo.Lock(LockType.Exclusive); docInfo.DeleteEdoc(); docInfo.Unlock(); } else throw new Exception("The document does not have an electronic attachment."); } } else throw new Exception("The bound entry must be a document."); } catch (Exception ex) { this.WorkflowApi.TrackError(ex.Message); } }
If you do not want to code it up yourself then an option would be to purchase the Delete Electronic File custom workflow activity from Qfiche available at www.qfiche.com/products. The Qfiche Delete Electronic File custom workflow activity has additional options to delete any electronic attachment or selected electronic files based on size or extension. The activity can also be configured to immediately purge the deleted electronic file from the recycle bin. All Qfiche Toolkit custom workflow activities available for download are fully functional 30 day demos.
What I've done in this situation is create a new document, move the pages, and then delete the original document with the electronic file.