FIND exact string from value list ='value'

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Platinum_ar
Posts: 92
Joined: Thu Jan 10, 2013 10:50 pm

FIND exact string from value list ='value'

Post by Platinum_ar »

I'm facing with trival problem that concern searching records with exact string, selected from value list.

My BO with attributes:
Document
Type

DocumentType (value list)
Name

Relation 1 to 1 with Document.Type -> Type

Values are:
K
KK-P

What I want to do, is give users ability to find only document with type K.
Now, when I select K from value list, result shows K and KK-P documents like with CONTAINS operator.
It's also important to set this search criteria on one, full form with all attributes.
So, user can:
- open search form,
- fill attributes that he wants
- select value from drop down Type
and system will find only docs with exact value in filed Type.

It's works fine when I type ='K' in Type filed but it's too complicated for regular user and regular use.

This could be serious problem in feature BS.

Do you already have a workaround for this, dear AwareIM community?
[/b]
aware_support
Posts: 7535
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

I am not sure I fully understand what the problem is but have you tried the "Filter Query" option in the presentation options of the reference attribute?
Aware IM Support Team
RocketRod
Posts: 907
Joined: Wed Aug 06, 2008 4:22 am
Location: Melbourne

Post by RocketRod »

A number of ways to do this as always the case in AwareIM. One way is to make you document type a drop down reference list. Then on the search form users can select the document type that they want from the list which will only find those equal to the value the user selected. If you want to retain the contains type search then just have two attributes on your BO. Set up a rule to copy the reference list description to your current attribute. Your search form can then be set up something like:

Document type contains:

Document type equals :

IN other words it contains two search attributes one which is a field to be entered as is the case now, the other which has a drop down list to select a specific document type.

Cheers Rod
Platinum_ar
Posts: 92
Joined: Thu Jan 10, 2013 10:50 pm

Post by Platinum_ar »

Thanks for response.

You mean, Filter displayed items option to filter values in drop down?

If yes, then this is not what I need.

I just want to find all Documents with Type = 'K' without 'KK-P'
When I select K in drop down on search form it works like with CONTAINS operator and returns documents with K and KK-P Type.

Image
RocketRod
Posts: 907
Joined: Wed Aug 06, 2008 4:22 am
Location: Melbourne

Post by RocketRod »

Try just adding a . after each value in drop down list?

Cheers Rod
Platinum_ar
Posts: 92
Joined: Thu Jan 10, 2013 10:50 pm

Post by Platinum_ar »

Thanks RocketRod!
One way is to make you document type a drop down reference list. Then on the search form users can select the document type that they want from the list which will only find those equal to the value the user selected.
I'm not sure but I think that this is how it is done now. Document Type is a drop down reference list. The lists of values is "collected" from DocumentType attribute and it doesn't seems to work as you mention.

Regarding to the second method, I must admit that I don't understand what you mean :(
can you explain more, please ?
Platinum_ar
Posts: 92
Joined: Thu Jan 10, 2013 10:50 pm

Post by Platinum_ar »

OK the trick with dot is pretty clever.
But I need to do it on any list where values looks like:
- small
- very small

because when I select small it will return also very small records.

Thank you RocketRod, this is good for now, we will be looking for more elegant solution in the future.
Platinum_ar
Posts: 92
Joined: Thu Jan 10, 2013 10:50 pm

Post by Platinum_ar »

One disadvantage is that we already have a rules based on 'K' value.
Now we need to make some changes or create hidden calculation filed with 'K' value and use it in rules.
RocketRod
Posts: 907
Joined: Wed Aug 06, 2008 4:22 am
Location: Melbourne

Post by RocketRod »

Further clarification.

1. As far as I am aware there is no way to stop users typing into a search reference drop down list field. So if they type in K it will bring back K, KK-A etc, you are correct. If however you can train them to always select from the drop down list itself then if you can also make the document types unique by adding a . for example at the end of the code, so K. KK-A. you should be ok. The user selects K. and it should only find K. not the others.

2. If you can't stop them typing in a K in the search field then set up a process with a PICK then DISPLAY QUERY in it so you have total control over how it works.

Cheers Rod
Platinum_ar
Posts: 92
Joined: Thu Jan 10, 2013 10:50 pm

Post by Platinum_ar »

Thanks Rod, but the trick with dot is pretty messy.
I still don't understand why this is such a big problem :(

If anyone has a better idea, please share.
rocketman
Posts: 1254
Joined: Fri Jan 02, 2009 11:22 pm
Location: Preston UK
Contact:

Post by rocketman »

Another solution - not sure how your users will like it.

get them to type ='K' in the box. This will force an exact match search
Rocketman

V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
Platinum_ar
Posts: 92
Joined: Thu Jan 10, 2013 10:50 pm

Post by Platinum_ar »

This is the solution that we consider as the only sensible.
This is often used feature and it will be unhandy for users but what else to do...

If only rules work on search form... we could create calculation for this field to get ='K' when user select K.

Maybe this is something that is worth to be added to TODO list, support?
rocketman
Posts: 1254
Joined: Fri Jan 02, 2009 11:22 pm
Location: Preston UK
Contact:

Post by rocketman »

You can control the search by using the ?ask at runtime feature when defining the search

FIND BO Where BO.Attribute1=? AND BO.Attribute2 =?'custom label'

OR

create a non persisting BO with the same attributes that you need for the search - and a form. Then in a process do

ENTER NEW NPBO USING your form
FIND BO WHERE BO.attribute1 = NPBO.attribute1 etc etc
Rocketman

V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

You can also build your own query filter form and use the results in the query. Below is the FIND statement for a query which uses 3 drop down references and 2 dates which are stored in the SystemUser BO:

FIND Movement WHERE (Movement.Movement.Description=LoggedInSystemUser.Selected_Movement.Description OR LoggedInSystemUser.Selected_Movement IS UNDEFINED) AND Movement.WhenCompleted>=LoggedInSystemUser.Selected_Date_From AND Movement.WhenCompleted<=LoggedInSystemUser.Selected_Date_To AND (Movement.Movement.Group_List CONTAINS LoggedInSystemUser.Selected_Movement_Group.Grouping OR LoggedInSystemUser.Selected_Movement_Group IS UNDEFINED) AND (Movement.Timing.Timing=LoggedInSystemUser.Selected_Movement_Timing.Timing OR LoggedInSystemUser.Selected_Movement_Timing IS UNDEFINED) ORDER BY Movement.WhenCompleted,Movement.TimingNbrSC,Movement.ID
Tom - V8.8 build 3137 - MySql / PostGres
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

You might want to check out the sample BSV at:
http://www.awareim.com/forum/viewtopic.php?t=6633
Tom - V8.8 build 3137 - MySql / PostGres
Post Reply