` Printed Icetips Article

Icetips Article



ABC: Fix to lookup browse not placed correctly
1998-10-18 -- Geoff Bomford
 
Newsgroups: TopSpeed.Products.C4.Bugs

>I recently converted a CW2003 app to C4b ABC templates. Everything seems
>to be working OK except for 2 noticeable problems.
>
>The first is that lookup browses for fields that require it always start
>the lookup browse at the top of the table and not at the record closest to
>the key field being entered (as in all previous versions of Clarion). I have
>double checked the code in both versions of the apps and there is no
>difference.

This is a bug in the template.  If you look at the code generated you will
see something like...( this is from the school app )

    OF ?ENR:ClassNumber
      ! Start of "Control Event Handling"
      ! [Priority 6000]

      IF QuickWindow{Prop:AcceptAll} = False
        CLA:ClassNumber = ENR:ClassNumber

! Change .Fetch to .TryFetch
        IF Access:Classes.TryFetch(CLA:KeyClassNumber)                !GWB
ABWindow Was .Fetch(


          IF SELF.Run(1,SelectRecord) = RequestCompleted
            ENR:ClassNumber = CLA:ClassNumber
          ELSE
            SELECT(?ENR:ClassNumber)
            CYCLE
          END
        END
      END
      ThisWindow.Reset(0)

The fetch method clears the record if no match is found, tryFetch does not
clear the record and so a match is found in the lookup procedure.  The fix
needs to be made in the ABWindow.Clw file.



Printed May 5, 2024, 1:35 pm
This article has been viewed/printed 35121 times.
Google search has resulted in 12 hits on this article since January 25, 2004.