This code is used for a field that returns a license number. The companies may have more than 1 license number. (The view shows all of the license numbers that have been issued.) How can I modify this code to return the most current license number?
Subject: RE: Need @DbLookup to Return Most Recent Entry
@DbLookup returns a list. Assign that to a temporary variable and use only the first element of that list. In general:
_res := @DbLookup(…);
_res[1]
I also noted, that you nested your if statements. That’s not necessary. @If in formula acts more like an @Case. Your complete code could look like this:
Subject: Need @DbLookup to Return Most Recent Entry
Modify the view so that it column that contains both license number and date. Do the @DbLookup, run through the list of results, and select the one with the most recent date, and then parse out the license number.