Sorry, gerade habe ich in der KBase gesehen, dass es so nicht geht:
@SetField Does Not Work as Expected in Field Formulas
Problem:
Notes database designers/users may observe unexpected results when using the @SetField function in a Field formula:
- An Input Translation formula uses @SetField to update another field on the same document, but the field does not get updated, either on a document save or refresh.
- A Computed formula which uses @SetField can cause other fields to be removed from the document.
Solution:
The fact that @SetField does not work in Field formulas was reported to Lotus Quality Engineering (spr #RMAS3QNKFL), and Notes was deemed working as designed. The use of the @SetField function within a Field formula can have unexpected results if it is used incorrectly.
A request has been submitted to Lotus Quality Engineering (spr #MGAN4N7NVW), asking for additional information to be provided within the Notes documentation/help concerning the programming practices to use and to avoid.
When using the @SetField Field formulas the database designer must be sure to use the function to set fields which are below or to the right of the current field. Also, whenever possible the database designer should simply use the FIELD statement itself to set a field.
For example, rather than:
FIELD FieldC := FieldC;
@SetField(FieldC; @Now);
one should use:
FIELD FieldC := @Now;
Additional issues to be aware of:
Additional problems can occur if the same Field formula that contains the @SetField also contains a conditional statement (such as @If) based on fields above (or to the left of) the current field. Fields may be deleted from the document as a result. The workaround is to perform the calculation in the form's QuerySave event.
For example:
Given a form with fields: FieldA, FieldB, FieldC, and FieldD, in that order down the form.
FieldA is a Computed field and contains the formula below:
@If(FieldB=FieldA;@Return(fieldA);"");
FIELD FieldC := FieldC;
@SetField(FieldC; @Now);"";
The problem with the above formula is that FieldB is referred to within the @If function, even though FieldB is below FieldA in the form.
Supporting Information:
The R4.5 and R4.6 documentation indicates in the "Where does this @Function work?" table that @SetField works in field formulas. The actual description indicates that it does not. This documentation error has been reported to Lotus Quality Engineering (spr #RMAS3QNL4B).