• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

Filter fields - multiple comparisons

Mike Mackinnon

Well Known Member
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C079A6.5ACC14B0
Content-Type: text/plain;
charset="iso-8859-1"

I have a form with a grid column for invoice date. The problem is that I
want to have a filter field that checks to see if the date is in a date
range entered by a user. If I use a field from the business view I can only
do one comparison using the "filter selection" method.

What I have done (temporarily?) is add 2 data dictionary items ("from" field
and "to" field) and added code in the 'Grid record is Fetched' event to
Suppress Grid Line' if the business view field is not in the date range
entered by the user. Does anybody have any other options that would work
better/faster? Thank you in advance.

Mike MacKinnon
One World B733, SP11.3, NT

------_=_NextPart_001_01C079A6.5ACC14B0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>Filter fields - multiple comparisons</TITLE>
</HEAD>
<BODY>



<FONT SIZE=3D2 FACE=3D"Arial">I have a form with a grid column for =
invoice date. The problem is that I want to have a filter field =
that checks to see if the date is in a date range entered by a =
user. If I use a field from the business view I can only do one =
comparison using the "filter selection" method.</FONT></P>



<FONT SIZE=3D2 FACE=3D"Arial">What I have done (temporarily?) is add =
2 data dictionary items ("from" field and "to" =
field) and added code in the 'Grid record is Fetched' event to Suppress =
Grid Line' if the business view field is not in the date range entered =
by the user. Does anybody have any other options that would work =
better/faster? Thank you in advance.</FONT></P>



<FONT SIZE=3D2 FACE=3D"Arial">Mike MacKinnon</FONT>

<FONT SIZE=3D2 FACE=3D"Arial">One World B733, SP11.3, NT</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C079A6.5ACC14B0--



One World;One World Xe; B7333; Windows NT
 

Zoltan_Gyimesi

Legendary Poster
Hello Mark,

Try the following:

1.) Put your date BusinessView column onto the Form as a Form Control (not into the grid but over it onto the grey header part). Use the Insert/Business View Field.
2.) Rename the ER name (and label) of your FC like "Xyyy Date From".
3.) Set the filter options of this FC as "Greater Than (or Equal)" starting from the Properties of this FC. (Consider to enable wild-card).
4.) Although you can not put the same BC as FC onto the form using Insert/Business View Field but you can select the first one (drawing a rectangle around it holding down left maouse button). Press Edit/Copy after you made your selection.
5.) Press Edit/Paste and place your copy onto elswhere on the form than the first.
6.) Rename the ER name (and label) of your FC like "Xyyy Date To".
7.) Set the filter options of this FC as "Less Than (or Equal)" starting from the Properties of this FC. (Consider to enable wild-card).

Save the APPL and try it.

If you don't want to enable these fields for the users then you can disable and/or making invisible these FCs and fill them with values in the "Button is Pressed" event of the Find HC Form Exit. (NOTES: It won't work for the first find if the "Find on Entry" is turned ON. In this case you have to assign the values in the "Dialog is initialized" event or clear the "Find on Entry" and call the Find HC with PressButton system function on the end of the ER in the "Dialog is initialized" event.)

Please, let me know that does it work on your site or doesn't or if you have further questions or need more clarification.

Good luck,
Zoltán



B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)
 

Mike Mackinnon

Well Known Member
Thanks again Zoltan! This process seems to work. I will test further and let you know if I run into any problems. By the way, the name's Mike. :)

Currently One World B733; SP11.3; NT

One World;One World Xe; B7333; Windows NT
 
Top