Updating Field Default Values With An Agent v7.5

40 pts.
Tags:
Lotus Domino
Lotus Domino development
LotusScript
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

Something’s not right here. Default values should only be calculated when the doc is first created. If your values update every time the doc is opened, then then it’s more likely that they are calculated fields, or calculated for display, or there’s code somewhere else (like a postopen event) that’s doing the updating. OTOH, if the code really is only in the default value, then that would explain why the ComputeWithForm isn’t working. I think you’ll need to clarify the situation before you can solve your problem.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Alan327
    Yes, the fields are computed and show the total derived from the @sum DBLookup formula. Sorry for the misunderstanding.
    40 pointsBadges:
    report
  • Stiletto
    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.
    3,860 pointsBadges:
    report
  • shivasanjay
    All calculation should be generally done on computed or computed for display fields. it is neat and quick
    2,510 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following