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

Question

Question

delete the document after certain years

asked on August 30, 2016

Hello all,

I am very new to this kind of development and having an issue with one workflow. Original requirement of workflow is to delete the document after 8 years of original created. The document is placed in the 3rd child folder of the root folder.

How can I go through the each folder and find the original creation date of the document and check if it is old enough to delete or not?

 

If anyone can help me out, that will be really appreciated.

Thanks

0 0

Answer

SELECTED ANSWER
replied on August 30, 2016

Workflow cannot access saved searches. You want to get the advanced search syntax for your search and use that in the Search Repository activity.

In the Laserfiche Client,  open the Advanced Search Syntax panel in the search pane, then run your search again. The Client will automatically fill in the search syntax for you. You can then copy it and paste it in the Search Repository activity.

0 0

Replies

replied on August 30, 2016

It is easier to approach this from a different direction. Rather than getting all documents and figuring out if a document is old enough, you want to start off by finding all documents older than 8 years. That way, you reduce the number of documents your workflow has to process.

So you want to start off with a Search Repository activity. You can run the search first from the Laserfiche Client and make sure you have the right search syntax (and documents). You can start off by searching for documents 8 years before today's date.

Then you can iterate through the search results with For Each Entry and delete them, no check is needed since the search does it for you.

At this point, you'll have a running workflow that deletes all documents created before 8 years ago today.

You can now extended it to run daily (with a scheduled starting rule) and check for documents that have aged out and need to be deleted. For this, you would have to add a Date Token Calculator activity and have it calculate 8 years before the current date (using the %(Date) token). Then you would want to modify the Search Repository's search query to use the token generated by Date Toke Calculator in its search instead of the hardcoded date from above.

1 0
replied on August 30, 2016

Thank You Miruna for the response.

I did search in Laserfiche client and found the expected documents. I saved that search and came back on workflow designer.

Now my questions is that How to access that saved search to get the same result that i had in Laserfiche client and delete those files?

 

Thanks

0 0
SELECTED ANSWER
replied on August 30, 2016

Workflow cannot access saved searches. You want to get the advanced search syntax for your search and use that in the Search Repository activity.

In the Laserfiche Client,  open the Advanced Search Syntax panel in the search pane, then run your search again. The Client will automatically fill in the search syntax for you. You can then copy it and paste it in the Search Repository activity.

0 0
replied on August 30, 2016

Perfect..!!!

Thanks a lot. It worked.

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

Sign in to reply to this post.