How to Recalculate formulas on backend documents?

I know this is a basic question, but I am unclear of how to do this.

What is the best way to recalculate formulas on a collection of documents?

From what I’ve read, computewithform only validates some events on the form and returns a value, and I can’t seem to find the proper way to do this.

Thank you for any help,

Shawn Ostermann

Subject: How to Recalculate formulas on backend documents ?

computeWithForm will recalculate all field value, input traslation, and optionally validation formulas.

It’s won’t fire any document events though.

Perhaps the biggest problem with it is that it won’t run @DBLookup or @DBColumn formulas. No idea why, but it can be a big problem as any other formulas that rely on this will fail.

If that’s not an issue, then you can ignore the rest, but if you need it to fire dblookups, then :

I get around it by having a “lock” field. For example, if a have a field called DataLookup which conatins a dblookup, i’ll also have a field called doDataLookup which is hidden, but editable. The default value is 1.

In the DataLookup field, I put:

@IF(doDataLookup = 1;@DBlookup(…);DataLookup)

This forces the field to just return the current value of the field if the doLookup has been turned off.

Then, immediataley before computewithform, set doDataLookup to 0, and set it back to 1 immediately after.

If you do need the compute to update dblookups, then you have to fire them using an evaluate statement in the lotuscript code. The write the result to your field. It’s a nightmare as you have to reproduce your entire field formula in script, but it’s the only workaround I’ve found.

HTH

Kiers