We use a form with a var radio group as the first step to editing orders.
1. The radio group items are used just to determine what field in the header
table to look at.
2. The var edit control is where we enter the information so a var lookup
list view shows the lines to choose from.
3. The EEP code for the var edit control is as follows on keystroke:
GETPROPERTY Keyword TEXTVALUE vKeyword
IF vKeyword = '*' OR vKeyword = '%' THEN
-- Define Where Clause
SET VAR vWhereClause = ('Control# IS NOT NULL')
PROPERTY LV_Quotes REFRESHLIST 'TRUE'
PROPERTY LV_Quotes SET_FOCUS 'TRUE'
PROPERTY ExportResultsAs ENABLED 'TRUE'
GOTO Done
ENDIF
-- Pre-define variables
IF (SLEN (.vKeyword )) < 4 THEN
GOTO Done
ENDIF
SET VAR vSearchString = (.vQuotes+.vKeyword+.vMany+.vQuotes)
-- Define Where Clause
-- Added this part for name fields (2/12/2010).
IF vSearchWhat = 'DistName' OR vSearchWhat = 'ShipName' THEN
SET VAR vWhereClause = (.vSearchWhat+' CONTAINS '&.vSearchString)
PROPERTY LV_Quotes REFRESHLIST 'TRUE'
ELSE
SET VAR vWhereClause = (.vSearchWhat+' LIKE '&.vSearchString )
PROPERTY LV_Quotes REFRESHLIST 'TRUE'
ENDIF
LABEL Done
--CLEAR VAR iv%
RETURN
The part that is super slow (though other fields can be slow at times) is when
we are looking for the customer name or the ship to name.
These columns are text fields 25 spaces long.
I use "contains" since sales will not always know the exact spelling at the
beginning of the field.
a. The table it is looking at is only 15,000 to 20,000 rows.
b. The fields Distname and Shipname are not indexed.
c. There are a total of 8 fields in this table that are either PK, FK or
indexed fields.
Do you have any suggestions on how to rectify the slowness?
James Belisle
Making Information Systems People Friendly Since 1990
[cid:[email protected]]