Revision history using formula language

This formula allows you to keep a revision history in a single computed field.

This formula allows you to keep a revision history in a single computed field. Unlike most such revision trackers, it does not rely on the QuerySave event. The formula tests if the current user's name is in the most recent entry in the field. If so, only the date is updated so you don't get multiple entries for the same person if there is no intervening editor. The results display like this:

Joe Smith 10/29/2001 12:40:08 PM
George Bush 10/29/2001 12:40:46 PM
Rob Pinion 10/29/2001 12:50:15 PM
George Bush 10/29/2001 12:50:41 PM


REM "To use this function change the field name below from displayUpdater to your field name";
REM "The field should be Text, computed, allow multiple values, display separate entries with New Line";

REM "Assign all current lines in this field to a temporary variable";

REM "Each new line will have the user's name and the current date-time";
newLine:=thisUser+" "+@Text(@Now);

REM "Now compare to see if the current user is the most recent editor";
REM "Get the last entry since it contains the most recent editor";

REM "First get a count of the number of lines --- elements --- already there";

REM "If there's only one line assign it to lastEntry var, otherwise assign the last entry to lastEntry var";

REM "Test whether the last line contains the name of the current user";
REM "Later we want to replace that line rather than adding a new line every time he saves the doc";

REM "Now get all lines but the last line";

REM "If the doc is being saved, then if this is same user return all but the last line followed by the new line";

REM "If this is not the same user, return everything preexisting plus a new line";

REM "If the doc is not being saved just show the contents of the field";


This was first published in November 2001

Dig deeper on Domino Resources



Forgot Password?

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

Your password has been sent to:




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...