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

Question

Question

Using Workflow to Delete documents after 1 year

asked on September 13, 2016

Hi Guys,

 

i need some advise on workflow regarding deleting document after 1 years.

Scenarios:

1. A System to output a PDF documents to a folder

2. Using Import Agent to monitor this folder and stored into Laserfiche Repository.

- In the process of storing the PDF, i will capture the creation date and save it as a metadata

3. 1 year later, i want to purge this document base on the creation date + 1 year.

Is it possible to achieve this? How can i make use of laserfiche workflow to design this objective?

 

Please advise.

 

Thank you

 

0 0

Replies

replied on September 14, 2016 Show version history

Hi Jason,

Edit:

I just realised that in workflow is a Date Token Calculator which you can use instead of script below.

You can try to search your repository for files before the date which is year ago from now.

You would probably need simple SDK to achieve that - something like:

string yearAgo = Convert.ToString(DateTime.Now.Date.AddMonths(-12));
this.SetTokenValue("YearAgo", yearAgo);

Before your SDK you need to create Token "YearAgo" with no value. Script will then set the token with one year old date.

Then you will use this token in following Search Query (Search Repository):

{LF:Created<"%(YearAgo)"}

This should return entries created 12 months before now. Then you can use found entries for whatever you need.

Please test this before deleting.

Hope it helps

 

 

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

Sign in to reply to this post.