I have a form with total fields that derive their value from a @Sum(DBLookup) default value formula. The totals update whenever the form is opened. However, I want to update the totals WITHOUT opening the form. I tried the following code in an agent with no success. Can this be done?
Set viewC = db.GetView"(StudentProfs)")
Set docC = viewC.GetFirstDocument
Do While Not docC Is Nothing
Call docC.ComputeWithForm(True, False)
Call docC.Save(True, False)
Set docC = viewC.GetNextDocument(docC)
Loop
Thanks!!!!!
Software/Hardware used:
Domino Development v7.5
ASKED:
October 6, 2011 7:43 PM
UPDATED:
March 31, 2012 12:30 AM
Yes, the fields are computed and show the total derived from the @sum DBLookup formula. Sorry for the misunderstanding.
In that case, I think you’ll have to make your agent do the dblookup and replace the field value. The down side, of course, is that if the formula changes, you’ll need to remember to change the calculation in both the field and the agent. Sorry.
All calculation should be generally done on computed or computed for display fields. it is neat and quick