Display QBE values on second form

Pat_H

Active Member
Hello, I have a find browse form that does a form interconnect to a modeless find browse form. If the user enters anything on the qbe line I want to display them on the next form. I've included the qbe variables on my data structure on both forms. There are three grid columns, Item Number (math numeric) and Item Desc 1 and 2 (both string characters). The DSC1 and DSC2 come over fine but the item number doesn't. Let's say I enter >=12345 on the QBE line for the item number. The next screen will only display 12345. It doesn't display the greater than or equal to sign. So the first thing I tried was to make the variable on the 2nd form that will display the QBE entry for ITM into a string character field equal (I used DD item DSC1 to create it) and also changed the data structures. I then did a convert math numeric to string and pass the converted variable to the next form. It still didn't work. Does anyone know of a way that I could get this working? Maybe a different business function to use? Thanks. We are running XE SP23, AS400.
 
I think you were on the right track with your second method, except with the 'convert math numeric to string'. That function is probably causing it to strip the >=, and only converting 12345 to string, which is giving you the same result/problem. Try skipping that step, and assign the ITM directly to your string variable before passing in the data structure.
 
Hi Pat,

Joining to Curtis's reply do not use BSFN for type conversion and try the automatic conversion simply assign values via Expression Manager.
Pass ITM into a string FI parameter and assign this to the QC field with the same way.

OK, OK, this is a shot in the dark - I've never tried this - but I'm curious to your results.

Regards,

Zoltán
 
Unfortunately just assigning the QBE value to a string didn't work. Bummer, I was hoping for a simple solution. I've run the app in debug so I could see the value of the QBE for ITM and it never has the >= character in it. I assume this occurs because the QBE grid column is also numeric. Thanks Curtis and Zoltan, I appreciate your help.
 
Hi Pat,

[ QUOTE ]
Unfortunately just assigning the QBE value to a string didn't work.

[/ QUOTE ]

I have tried and I was able - alsp XE SP23.

I have written:
[ QUOTE ]
simply assign values via Expression Manager

[/ QUOTE ]

When you open the Assignment a selected the string variable as left hand operand, then press the f(x) button beside the righthand operand, select QC from the left lower window of Expression Manager window with double-click and press OK.

Did you do this way? If not, then try this way.

Good luck,

Zoltán
 
Hi Pat again,

I am just working on a simple APPL of mine with two forms, so I quickly tried my solution. This cann pass the numeric value of QC to the string but the relational operator lose
frown.gif


By the way, what is your real goal with this odd issue?
Maybe there is other work-around to accomplish that.

Regards,

Zoltán
 
Hi Zoltan, what I meant by "it didn't work" was that it still didn't bring over the relational operator. Sorry about that. The goal of wanting to display the qbe data on the second form was to show the user what they had queried on the first form. The second form is a modeless form so the user has the next and previous buttons to display other records from the business view over the item master. The QBE is restricting them to only see data that matches the criteria, they can't go any further or back in the file and I wanted them to know why. Example: Let's say the item master only contains 5 items (1,2,3,4,5), the user enters >=3 on the qbe for the item# field, he selects item 3 from the list and the 2nd form displays item 3. If they hit the next button it lets them view items 4 and 5. When they hit the back button they can only see items 5, 4 and 3. It's not going to let them see 2 or 1 even though they do exist in the view. Are you thinking there may be a better way of doing this?
 
I'm with Zoltan (the Great) on this one. What is the REAL reason you want to copy the filter values? I would understand the reason if you are checking a different table (with the same QBE field types) and expecting different records.

If, on the other hand, you want to see a different set of records based upon the key fields for the result set of the first grid, then there is a tricky way to get around it. First, the scenario to make sure we are talking apples to apples.

Suppose the first F/B grid is displaying Sales Order Detail information and so you are filtering on Unit Price less than $100 and Next Status greater than or equal to 420. You then want to see the same set of grid records from an auxiliary table for the same set of records on a new F/B grid. If this is the case, then what I do is create a work file with the keys for the first grid (with a unique id). When I create the second F/B form I use a business view with the work file joined (with simple join) to the second table. When I call the second F/B form I pass the unique number and filter on it. Magically, the second grid contains all the desired records.

You will also need to be sure to perform cleanup for the worktable so it doesn't get unwieldly huge, and the unique id saves you from having to worry about multiple simultaneous users.

Hope this helps,
Ben again,
 
Hi Pat,

I supposed the same goal as Ben did and you described now.
My next suggestion would be the same, that Ben described so nicely.

[ QUOTE ]
Are you thinking there may be a better way of doing this?

[/ QUOTE ]

Yes, I am
cool.gif
Check Ben's reply
cool.gif


Let me some comments and add-ons:

1.) In your not feasible method the users can override QBE values, so they are not really restricted to reach the omitted records - but in the work file method they are.

2.) Work file method works for all filtering on the 1st form, regardless this how is made it - on a filter fields, on QBEs or by ER code.

Hence force WFT = Work File Technique
3.) Further advantage of WFT, that the user can filter on 2nd form for a subset of the original set - if she/he wants.

4.) The only weakness of WFT (in this way), that you should turn off "Page-At-A-Time" processing on the first form to acces all possible record for the filtering.

I frequently used WFT in the past, but a bit other way - if my memory serves me well, I had posted it one or more times to JDEList. Just a brief overview:

NOTE: this is on XE, fat client, CITRIX or WTS.

1.) (Just a bit addition to Ben's post)
- I use UKID for unique WF ID for each session. This is the first field in WF as well in the only primary index of WF. The WF contains all field of the primary index of the original WF and they are also part of the WF index.

2.) I get this UKID value with Get Next Unique ID Business Function call, passing the object ID of my WF (e.g. F550121W) (note using this BSFN does not require previous setup, it will create the entry in the Next UKID table, if it does not xist and starts with 1.

3.) I make the chance for the user to select a sub-set of rows of the filtered set. This is static selection (all is on the 1st Form):
- I enable the Multiple Row Selection
- turn off Hide Row Header
- I use a grid scope variable to indicate, which row is selected
- I use Select, Clear Selection, Toggle Selection Row exits with turned on Repeat for Grid event option - to play with my grd variable
- I use Set Grid Row Bitmap system funtion to display a Check-Mark or X-Mark on the row header, to show, is the row currently selected or not
- if the form requires attachment handling (this occupies the Row Header), then I place a disabled column as first column onto the grid and I display here the green Check-Mark or the red X-Mark
- generaly I add some Form Exit too, as Select All, Clear All (Toggle All)
- I build the work file before I call the 2nd form, and I insert records only, when my variable is 1 on the grid row (I suppose, do you know, how can you go thru on all of the grid rows and do it)
- I delete the WF when 2nd form returned
- I do not turn off Disable-PageAt-A-Time - the user can go to the end of the selected rows on the grid with CTRL-End, if she/he wants to deal with all filtered rows

That's all briely
cool.gif


Hope, this a bit help for you.

Regards,

Zoltán
 
I understand what you are both suggesting (the work file method) and I really do appreciate the thought you've put into your answers. All I really wanted to do is to capture the relational operator entered in the QBE field on the first form and display it on the second form. I don't know that it's even possible regardless of the variable being numeric or a string. I’ve run tests with both types of variables. Thanks for all your help.
 
Back
Top