Please consider making a mod to vvUtility_suggest to allow it to do 'Contains' searches as well as the current 'Starts with' searches.
I have a customer information string that contains the customer's number, name, address, city, state, zip, country.
I made changes to the vvUtility_suggest to allow it to do 'Contains' searches so I can key in whatever information I know about the customer, like name, number, city, etc and it suggests customers.
I realize the ramifications of changing code in the Valencexx library. I backed out my changes and thought I'd suggest the change via the forum.
Feel free to use my code if you wish.
I have a customer information string that contains the customer's number, name, address, city, state, zip, country.
I made changes to the vvUtility_suggest to allow it to do 'Contains' searches so I can key in whatever information I know about the customer, like name, number, city, etc and it suggests customers.
I realize the ramifications of changing code in the Valencexx library. I backed out my changes and thought I'd suggest the change via the forum.
Feel free to use my code if you wish.
Code:
p vvUtility_suggest...
p b export
d pi
d inValue 150a const varying options(*varsize)
d inFieldName 10a const varying options(*varsize)
d inFileName 10a const varying options(*varsize)
d inNumToReturn 3 0 const
d inWhereCond 512a const varying
d options(*varsize:*nopass)
[COLOR="Red"]d SearchType...
d 1a Const Options(*NoPass)
D SearchTypeString...
D 200a [/COLOR]
[COLOR="red"] // Build search type.
SearchTypeString = *Blank;
If %Parms >= 6 And %Addr(SearchType) <> *Null And
SearchType = 'C';
SearchTypeString = 'Like ' + SQ + '%' + %Trim(Compare) + '%' + SQ;
Else;
SearchTypeString = 'Like ' + SQ + %Trim(Compare) + '%' + SQ;
EndIf;
// Build the sql statement...
Stmt = 'Select ' + %Trim(inFieldName) +
' From ' + %Trim(inFileName) +
' Where Upper(' + %Trim(inFieldName) + ') ' +
%Trim(SearchTypeString); [/COLOR]

Comment