` Printed Icetips Article

Icetips Article



ABC: Retrieving whole records on lookup
1998-12-31 -- David A. Bayliss
 
Newsgroups: topspeed.products.c5ee.bugs

>Setup a lookup to a browse on a field accepted with the ABC template. After
>the lookup, when the data comes back from the browse, the only data
>available is what was in the lookup browse - NOT the entire record. In the
>CW templates, the entire record is retrieved.
>
>I don't know whether this is intentional, but it sure is dumb! Why would
>anyone want to only retrieve a piece of a record on a lookup?

If one is using databases in a third normal form fashion then it is both
possible, reasonable and extremely efficient to identify a file from the
value of its primary key. In addition to the primary fields most selects
will populate  few fields to act as a textual primary (a visual cue to the
user), these also get returned to the form to act as a visual cue.

Traditionally CW has returned the entire file record from a select instead
of the primary field. I don't know if this was intentional but it sure is
dumb.  Why anyone would want to load an entire record when they are only
going to use a couple of fields is hard to fathom.

Forcing the callee to do a reget (v. expensive, esp. under SQL) just in case
the caller might happen to want certain values is a classic example of why
machines are 1000x faster than they were 20 years ago but don't -run- any
faster.

Anyhow, in C5EEA there is a SelectWholeRecord field which can be set on the
browse which -will- force the full reget. This way, people get to choose the
way they work.

DAB

>A work around this is to retrieve the entire looked up record in the
>accepted embed just after the goofy lookup.
>
>I think this is due to the use of "IF SELF.Run(1,SelectREcord)" which
>somehow only retrieves the browse cue in the lookup browse, but I can't
>prove it. I can't find any documentation on SELF.Run(). Does anyone know
>what this does and why?



Printed November 21, 2024, 6:49 am
This article has been viewed/printed 35383 times.
Google search has resulted in 13 hits on this article since January 25, 2004.