Manage Learn to apply best practices and optimize your operations.

Using @ThisName to write portable code

In Domino R6, the @ThisName function returns the field name and is very useful in writing portable code.

Editor's Note:
This tip only works for ND6.

You may use this function extensively to eliminate the hard coding of field names. It is especially useful when you have a lot of fields. and each time you have to write the field name in several sections of the field design areas.

In addition, you may write your codes as a context, so that you may use it whenever you need it regardless of the need to re-assign the field name.
For example, you may use it to trim the value in the input translation section like (@Trim(@GetField(@ThisName)) or, for a multi-value field, @Unique((@Trim(@GetField(@ThisName))).

You may also use it in the def value and validation sections and a lot of aspects of field value processing.

Note: In this context I tested the function (@GetField) in a multi-value field and I found it working well, but not as documented (that is, it returns only the first value).

Do you have comments on this tip? Let us know.

Dig Deeper on Lotus Notes Domino Formula Language

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • 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 ...