How can I ....

Euroboy

Active Member
Hi List,

help!!

I need to determine how many lines have been highlighted for selection. I am in a headerless detail form and need to do some processing for the multiple selected lines - part of which is to apportion a fixed cost to each of the lines selected - NOTE!! not the number of lines in the grid BUT to a subset of those (ie those hi-lighted).

I am going to do this on a row exit.

Hope someone can help.



OneWorld B733 SP11.3 using Oracle Database
 
Instead of using a highlight try the following;

Create a Grid Column called Select
On the Grid Event Rule, "Double Click on Row Header" if the Grid Column
"Select" is blank, move a "1" else if it not blank, then make it blank.

You can look at Ship Confirm, P4205, to see how it is done.

Ken Stern
OneWorld Developer
Andrews Consulting Group
 
In event rules design for the row exit button, under Options menu click
Repeat for Grid. This will cause the event rules to fire for each selected
row.
 
are you asking how to count number of rows selected before processing any row?

If yes..

1. Create two form variables, one will be a counter ( e.g. MATH06) the other a
flag (e.g. EV25)
2. Create a hidden button - add the ER logic (MATH06 = MATH06 + 1) - make this
button repeat for grid
3. Add this ER logic to your Row Exit (which is also repeat for grid)
MATH06 = 0
If EV25 = 0
Call hidden button
EV25 = 1 (- you only want to do this once for each press of the row
exit)
Endif

EV25 needs to be set to and reset but this depends upon what your application is
doing. After pressing the row exit the hidden button will be pressed (if EV25 is
0) and it will increment the counter.

Cheers
 
Hi Andrew,

Yes, I am asking how to count number of rows selected before processing a row? Reason is there is a fixed cost to be set against the rows, irrespective of number of lines selected. eg cost will be £200 over the lines (so if 1 line/row is selected, cost will be £200; if 10 are selected, cost will be £20 each)

I think I see what you are saying ... so I'll give it a go now.

The only problem I see right now is when I call the first button (to determine the number of rows selected using repeat for grid set), will it reprocess all the grid lines when it comes back to the calling button which also will have the repeat for grid set.

Will let you know how i get on.


Thanks again.








OneWorld B733 SP11.3 using Oracle Database
 
The EV25 flag I used in my example will only allow the hidden button (where the
count takes place) to be called once per press of the row exit. This flag needs
to be reset for subsequent presses of the row exit.
 
Hi Euroboy,
I have just read the entire thread of your issue and I wonder that nobody has mentioned the "Get Selected Grid Row Count" System Function (Grid category).
It returns the number of the count of selected rows. First parameter is FC Grid (this is the only available choice) the second could be a math numeric type (e.g. a variable based on MATH10) to get back and hold the counters.
I really hope that this System Function is also available in your OW release.
Please, let me know that is it or not and if it is then is it a solution for your original problem. Thx.
Zoltán



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

Yes I did spot that --- but only after all the above posts.

I was going to use it ... but then because of certain reasons I could'nt - nothing to do with JDE's fault. I had to check certain grid column properties so it meant I had to go through each of the grid rows selected one by one (so I did a row count at the same time).

I did find though the following:

While in a repeat for grid selection I was calling a row exit. The row exit was executing a push button which was doing the 'get selected row count' mentioned above. However I would then get a different answer to the row count when the 'repeat for grid' had moved on to the next row. Hope you can understand what I mean.


Zoltan, can you help with the PO problem Ive also posted?

TIA


OneWorld B733 SP11.3 using Oracle Database
 
Hi Euroboy,

You mentioned your observation about "Get Selected Grid Row Count" called from a push button wich is called from a row exit with "Repeat for Grid" attribute.
IMHO, it is a normal behaviour because the row exit will iterate through the selected grid rows, decreasing the selection counter in each iteration.
A better solution could be:
1.) Do not set "Repeat for Grid" for the row exit.
2.) Get the selection counter in the row exit and put it into a form scope variable.
3.) Set the "Repeat for Grid" attribute for the push button.

About your PO issue - read me there.

Zoltán

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