E9.1 Multiple Selection with one click


Hi all,

my name is Oliver and I work with 9.1 / TR

I have a really big problem with the record selection in the grid, multiple Selection is enabled, Find and browse.

For example, I show 100 Sales Orders with 10 different Customer numbers in the grid.
Now, my customer wants to click on a Grid column, for exampe, AN8, all referenced Sales Orders of this AN8 should be selected.

This is already done, event "Grid Cloumn is clicked" => max Grid records, a Loop through all records in the grid, when GC_AN8 = var_AN8 then Change the row selection and store this Character(0/1) in the Grid.
When the user clicked again on the same GC_AN8, I have to unselect all Sales Orders wih this customer number, when 1 => 0 and 0 => 1.

That's works fine.

But I have to support a multiple selection with more than one customer.

First click on AN8 = 15, mark 10 sales Orders with thsi referenced customer, works fine!!
Second click on AN8 = 48, now my problem is starting.

I saw in the debug mode, that the system deselect all selected rows with AN8 = 15, ????, in case of selecting AN8=48.
After "Deselection all" , the system only mark the selected record, and i have to reselect all "old marked" records with An8 = 15 and I have to mark all records with customer 48.
So I have to check, unselected records with Stored Character of selection before.

This works not really pefect, but it becomes really terrible, when the user use the check box on the row header for selection, because my event is not triggered in this case.

Does anybody have an idea, where i can suppress this funny "system behavior"??
Does anyone have experience with multiple selection on Grid column events?
Does anyone have a workaround for my problem?

Thx Oliver


VIP Member
Hi Oliver,

I am going to suggest a couple of things that will probably off-target because we don't know everything yet - like what are you doing after everything is perfectly selected.

1) Create a hot link in the grid - that when clicked, copies the value into the QBE and performs a new Search. Now your grid only has the one AN8 in the entire grid and you can perform a Row Exit for whatever - and clicking on the checkbox above the grid will select ALL. This is MUCH easier than working with multiple AN8s.

2) If you absolutely must have multiple AN8s, I would probably start hot link on AN8 which loads the AN8 in a custom table (along with two buttons - one to clear the table and one to execute the Search (which will now have the custom table linked into the grid search so that it only loads those records) and then your row exit - or whatever just works on the existing records (again, the checkbox above the grid will select ALL and clicking on the rows can deselect????).

Good luck,
Ben Again,


Well Known Member
Could you try moving the logic to a new row exit?
Works the same, highlighting one row then taking the new row exit to perform the 'select matching AN8' looping logic?

You would have 2 loops. One to use Get Next Selected Row. Then another to read through the grid find and the matching AN8s. (Or use Repeat for Grid)
Then repeat this logic for your next selected record.
It may work exactly the same way, I just have a hunch in my head it might be cleaner for the forms engine to work out where it is.

I am not sure how this would work if the user selected 3 GCs, 2 for AN8 = 15 the 3rd for AN8 = 48
I have a custom screen over F4211 as well, and I perform all sorts of logic on selected records like you appear to be doing. It's all working off of Row Exits and hidden buttons for repeated logic.

Also note some of this grid looping logic won't work on a local FAT, you have to invoke the local web

This is example code in a hidden button I call from a Row Exit

Button Clicked 00002 // Loop through grid and validate each selected row
00003 //
00004 VA frm_iLineIn_INT01 [INT01] = "0"
00005 VA frm_iLineOut_LINT01 [INT01] = "0"
00006 //
00007 // Get First Row
00008 Get Next Selected Row(FC Grid, <Before First Row>, VA frm_iLineOut_LINT01)

While VA frm_iLineOut_LINT01 [INT01] is greater than VA frm_iLineIn_INT01 [INT01]
00010 | // Process the Grid
00011 | //
00012 | Get Grid Row(FC Grid, VA frm_iLineOut_LINT01)
00013 | //
00014 |

If GC Shipment Number [SHPN] is less than or equal to "0"

00015 | | VA frm_cShipmentBlankY_EV01 [EV01] = "Y"
00016 | | Set Grid Cell Error(FC Grid, VA frm_iLineOut_LINT01, GC ShipmentNumber, "053P")

00017 | End If
00018 | //
00019 | VA frm_iLineIn_INT01 [INT01] = VA frm_iLineOut_LINT01 [INT01]
00020 | //
00021 | Get Next Selected Row(FC Grid, VA frm_iLineIn_INT01, VA frm_iLineOut_LINT01)
00022 End While
Last edited: