Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execute Notes field default formula from agent

Status
Not open for further replies.

Alan327

Programmer
Sep 22, 2008
4
US
Domino Development - 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
 
When you open a document, the form you use has access to the UIworkspace object.

When you run an agent, you cannot access the UIworkspace, thus your @Sum(@DBlookup) cannot execute.

You can use an agent, but you will have to replicate the calculation in the code and enter the result in the document for the result to correspond to your wishes.

Pascal.

I've got nothing to hide, and I'd very much like to keep that away from prying eyes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top