cancel
Showing results for 
Search instead for 
Did you mean: 

Implementing find mode in a form

Former Member
0 Kudos

How is find mode implemented in a form?

It's easy enough to have the form mode set to et_FIND_MODE, allow input, and catch the event for when the find button is pressed. Then what do you do?

DBDataSource.Query(condition) doesn't seem usable since there's no way I see to implement a "like" condition for when the user enters something like "abc*" in one of the search fields.

Does this type of functionality require using a recordset and DoQuery and building your DBDataSource collection from the recordset by going through each result in the recordset? That's the only way I can see to do it from what I know at this point.

Any assistance is much appreciated!

Bill Faulk

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can implement a "Like" condition using a DBDataSource

for example you want CardCode LIKE 'abc*'

this would be

dsa_Conditions = New SAPbouiCOM.Conditions
 
dsa_Condition = dsa_Conditions.Add
dsa_Condition.BracketOpenNum = 2
dsa_Condition.Alias = "CardCode"
dsa_Condition.Operation = BoConditionOperation.co_GRATER_EQUAL
dsa_Condition.CondVal = "abc"
dsa_Condition.BracketCloseNum = 1
dsa_Condition.Relationship=BoConditionRelationship.cr_AND
dsa_Condition = dsa_Conditions.Add
dsa_Condition.BracketOpenNum = 1
dsa_Condition.Alias = "CardCode"
dsa_Condition.Operation = BoConditionOperation.co_LESS_THAN
dsa_Condition.CondVal = "abd"
dsa_Condition.BracketCloseNum = 2

Former Member
0 Kudos

Sébastien, thanks for the reply.

Unfortunately, the user can always put in "abc" or "*abc", and so on, so querying for a recordset and building the dbdatasource object from this seems the way to go. Also, there can be a separate condition for each field the user can enter in find mode which makes for lots and lots of coding.

It'd be nice if there was an alternate version of DBDataSource.Query() which let you just specify a string for the where clause.

Also, I've found that for "flat" forms the thing to do seems to be to build the result set and use a data browser so that the matching records can be navigated with the buttons. In this case I think you have to use a recordset anyway.

AlexGrebennikov
Active Contributor
0 Kudos

Hi, Bill!

>>It'd be nice if there was an alternate version of

>>DBDataSource.Query() which let you just specify a

>>string for the where clause.

It would be a best solution for your issue, and i've resently read a message, where Frank saying that this feature is planned for v.2005

I suppose there is only one solution for now: it is using of DI-RecordSet to run a codegenerated query to find appropriate records..

Answers (0)