NetTalk Central

Author Topic: Drop Down Performance  (Read 2816 times)

RichBowman

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
    • Email
Drop Down Performance
« on: December 27, 2011, 10:14:16 AM »
I have a Memory form with 3 drop downs and a Browse control. Dropdown 1 filters dropdown2. Both of these are used to filter dropdown 3. The last dropdown file has about 1,500 records. The filtering causes only a few to be displayed at any one time. However, when I put some trace code in the validate routine for dopdown 3 I find that it is executed once for every record in the file, not for the ones displayed or just the one selected.

This happens twice, when dropdown 2 is selected (since it resets dropdown 3) and then when a selection is made from dropdown 3. So, just to make my selections. before it ever goes to the main file, it is reading 3,000 records.

I can't use a lookup since the idea of the dropdown is that the user doesn't know what to enter.

Is this the way this is supposed to work? Is there a better way?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Drop Down Performance
« Reply #1 on: December 27, 2011, 10:13:34 PM »
Hi Rich,

two things spring to mind;

a) make sure the default filter for the 3rd dropdown is "nothing" rather than "everything". ie before 1, _and_ 2 are selected, you don't want the 3rd one to read any records. this probably means setting default values for 1 and 2 to something that will completely empty c.

b) you can add a _trace statement in the code to see what the "actual filter is set to". This is very handy because the VIEW structure "retrieves all records if the filter syntax is wrong". So most cases of "filter not working" is simply because it contains an invalid filter. For example the filter
'fil:something = ' & p_web.GSV('somethingelse')
is invalid when something else is blank, and so you get all the records.

Also - what backend (SQL, TPS etc) are you using?

cheers
Bruce