S&TT - Using ComputeWithForm to Refresh documents via a Scheduled Agent
This may be old hat to some of you, but it was new to me, so I'm posting it even if it's only for my benefit in some future coding endeavor.
I have some documents in a view which have a computed "days past due" field which calculates based off another computed/looked-up field and the current day's date.
Nothing else on the document is computed or in any way complicated, so I thought I'd just see if I could find a way to re-compute the documents each day. While doing some searching in the 6 and 7 forum, I came across this gem.
Instead of a running on a collection, I just have it run through my view and it does the job neat and tidy, and I have it scheduled just after midnight so all is good for the day when the users look at the view.
Set doc=mr_view.getFirstDocument
Do While Not doc Is Nothing
Call doc.ComputeWithForm(True,False)
Call doc.save(True,False)
Set doc=mr_view.getNextDocument(doc)
Loop
I hadn't known you could use computewithform in this way, but it appears you can...
Gotta love 6 1/2 year old forum posts!











