A Faster Alternative To Using A Dblookup

If you want a certain value to display based on what a user selects in another field, most of the time this can...

be done easily with a dBLookup, but sometimes there can be a significant delay if the database is large. In order to speed this up, you can compute the lists available to the user in the PostOpen event to make them available on the new document being created and then use the @Member function. Country_Names : This field contains a list of Country Names (i.e. Canada, United States, England). Hidden, computed field. Can be calculated during the PostOpen event for the form based on the user, role or some other criteria. Country_Desc : This field contains a list of corresponding descriptions for each Country (i.e. Great White North, The Land of the Free, The Home of Royalty and Boiled Food ). Hidden, computed field. Must be computed based on the same criteria as Country_Names in order to contain the corresponding descriptions. Selected_Country : Keyword field with the following formula for the list of keywords : @Trim(@Unique(Country_Names)) Display_Country_Desc : Computed for Display field with the following formula : index := @Member(Selected_Country; @Trim(Country_Names)); @If(index = 0; Display_Country_Desc; @Trim(@Subset(@Subset(Country_Desc; index); -1)))

This was first published in November 2000

Dig Deeper



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

    Search400.com'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 ...