1
votes

One of my fields in a form in notes designer has the following code:

viewhire := @If(@IsMember(@UserName; WillNotify);@UserName;
    @IsMember("[SuperUser]";@UserRoles);@UserName;
    @IsMember("[Finance]"; @UserRoles);@UserName;"INVALID");

@Name([Abbreviate];viewhire)

The problem with this code is the first person to open the document has his username set in this field. So the next time a different user trys to open the same document his name does not appear in the field till he refreshes the document only then his username gets inserted in the field.

Any ideas to over come this problem ? One way I thought of is if i can insert this code on "Open document" then it will solve it but i am not sure or know if this is possible ?

I am using Domino Designer 8.5

2

2 Answers

4
votes

Define the field as "Computed for Display" rather than "Computed" and the field will be calculated on document open properly. The only disadvantage is that the field is not stored in the document though.

0
votes

Leave the field as computed and put the following in the form PostOpen :

Source.refresh

This causes an immediate recalculation of field formulas as the form opens regardless of edit mode or not, but wont work on the web.