Help with Grid Question

jdewannab

Active Member
List,
I have a headerless Detail form that I need to do multiple updates to the grid, But I only want to update the highlighted Grid rows. How would this best be accomplished? Such as I highlight grid rows 1-5,7,10. How do I know something was selected and how do I read those rows?

If you need to contact me direct, you can at jdewannab@hotmail.com.

Thanks in advance,
Jimmy
 

Christian Audet

Moderator
Staff member
Hi Jimmy,

Once in your grid you activate the "Multiple Select" option.

Go to your event (Like a Form exit button "Update"), in the event rules activate the "Repeat for Grid" under the Options menu.

After this setup the event will be automatically called for every selected row. Your way to know the currently executed row is in the GC values.

Christian Audet


Implementing B7333 (Xe) SP14.1, SQL
(Support B732, B7331 and B7332)
 

barrier

Reputable Poster
Jimmy,

In event rules for "whatever" Button Clicked (be it the OK or a user
defined button), under the Options menu select Repeat For Grid. The event
will fire for each of the selected rows.

(I assume that you not updating the BSVW from the grid).

B.
 

Bill_Feeney

Active Member
Hi Jimmy and Christian,
As always I have learned some valuable insights in coding in JDE. The
question I have for Jimmy is this. If you are on a headerless detail form
and want to update only certain rows that are highlighted, have you entered
the row to make the change or is it a general update using some value? If
you entered the row would it work for you to put your update on the "Row is
Exited..." ER?
Christian,
I was playing with your suggestion and was wondering if this is the method
most likely used by a "Copy or Export Selected Rows" kind of ER?

Bill Feeney
JDE Technical Developer
B733.2, SP 13.1, Unix, Oracle 8.1.6




Bill Feeney
B7332 SP 13.1 Sun Unix Oracle 8.1.6
 

jdewannab

Active Member
Re: RE: Help with Grid Question

Bill,
There's only problem with putting the update on Row Is Exited. If the user changes multiple records then decides to cancel you have already updated the records.

I am going to play around with these suggestions, I anyone has anymore insight, I would love to hear it.

Thanks all for your help
 
Jimmy,

You might take a leaf out of the ship confirm screen (P4205). There is a
button called confirm multiple lines on the row exit of the second screen.
JDE has also added a non DB column on each line of the grid so that the
application can determine if the line should be updated.

Hope this helps.

Steve Schofield
sschofield@aimtronics.com
B732.2 NT SQL 7.0
 

Bill_Feeney

Active Member
RE: RE: Help with Grid Question

Please keep us posted on your progress and results. I am very interested in
the outcome.

Regards,

Bill Feeney
JDE Technical Developer
B733.2, SP 13.1, Unix, Oracle 8.1.6




Bill Feeney
B7332 SP 13.1 Sun Unix Oracle 8.1.6
 

Zoltan_Gyimesi

Legendary Poster
Hi Jimmy,

Have you tried simply to set the Repeat For Grid for the Button Clicked event of OK button? I do not know how does it work for OK, but maybe it could be the simpliest solution if it works. I am very curious it. Let us know when you have tried it.

If the previous does not work then try the following:
1.) Add a grid variable (Form scope) or a hidden column to the grid (e.g. grd_RowHadBeenSelected_EV01).
2.) Add a hidden button to the Form (e.g. MarkSelectedRows_HIDDEN) and attach the simple logic:
grd_RowHadBeenSelected_EV01 = "1"
to the Button Clicked event of it and turn on the Repeat For Grid too.
3.) Press the button in the first line in the Button Clicked event of OK:
PressButton(MarkSelectedRows_HIDDEN)
4.) Attach the following logic:
If grd_RowHadBeenSelected_EV01 is not equal to "1"
SuppressUpdate
EndIf
to the Update Grid Rec to DB-Before event of the grid.

Hope, it will work properly.

Please, share your results with us. Thanks.

Good luck,
Zoltán

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

Christian Audet

Moderator
Staff member
Re: RE: Help with Grid Question

Bill,

As you mention if you want to use this method to copy record, that can work, you just have to change the key field for the new copy.

In that case working with the GB variables and the system function "insert Grid Row Buffer" you will be able to copy a record that way.

Christian Audet

Implementing B7333 (Xe) SP14.1, SQL
(Support B732, B7331 and B7332)
 
Top