Scheduled Agent to create documents via schedule in a view
Posted on 2006-07-20
I've just asked a very similar question to this, and am forever grateful to Sjef for helping out with it.
Unfortunately as always I now need to take this a step further...
Here is the situation...
I have an agent that runs daily.
It collects documents from a view and creates new documents depending on the day of the week.
This works by comparing weekday(today) with the value in a combobox on the form
What I need to achieve now is to set this up so that somehow it can create documents spanning multiple weeks.
i.e. at the moment I can only create the same documents every week. I need to be able to specify for example create document every 4 weeks (28 days) on the form.
I'm stuggling with working out how I can set this up.
I'm thinking along the following lines:
Field: Start_LastRun_Date = user specified date
Field: Repeat_Every = user specified period (days)
Field: Collection_Date = computed date (start_date + repeat_every)
The agent which runs daily should collect documents from the view where Collection_Date = Today
It should then create this document through form2. It should also modify the Start_LastRun_Date to = Now
and save the original document. Thus the original document's Collection_Date will recompute to the next period, and the cycle will begin again.
Hope that makes sense?
Points awarded for:
a) verifying this is all possible and will work
b) help creating an agent to do all this!