Can't make Headerless Detail features work

Bob B

Guest
Can\'t make Headerless Detail features work

Created headerless detail form. "Update on Grid Business View" and "Fetch on Grid Business View" options are checked. For grid properties, "Multiple Select" and "Update Mode" advanced options are checked.

Added a button for Delete action, and for the "Button Clicked" ER, specified "Repeat for Grid" in options.

Two problems I am having:

When I add rows to the grid and click the OK button, the records are added/updated but the application then closes. I want it to stay active, and ideally, do a Find so all records are again displayed.

The ER behind the Delete button is executed only once - I know this because I traced the execution in Interactive Debug. When multiple rows are selected, I want the ER for the Delete button to run for each row selected. My understanding of the settings described above is that this should happen but appears not to.

What am I overlooking?
 
Re: Can\'t make Headerless Detail features work

Problem 1) Is the headerless detail propery - End Form on Add checked ? It should be unchecked. If this does not work, create another form, for eg a Find/Browse that calls the headerless detail form. The call should be modal (i.e Modeless option of the call command is unchecked).

Problem 2) Move the delete code to the Post button clicked and test.
 
Re: Can\'t make Headerless Detail features work

Problem 2: In addition to what Null Value suggested, also make sure in Grid Properties -> Options, "Process All Rows in Grid" is checked.

Thanks
Gautam
 
Re: Can\'t make Headerless Detail features work

Check your suggestion for #1 - no, that property is not checked. I may try a header detail to see if that will work the way I want.

Tried suggestion #2, and it also only executed once, despite the option turned on for Repeat for Grid. In addition, the code using system functions to get next selected row and get grid row to set up subsequent Delete I/O operation fails to return a correct row number - always "-1". This is the bugger that has me most concerned.
 
Re: Can\'t make Headerless Detail features work

Have you tried to "Suppress Add" on the OK button clicked, and "Suppress Delete" on the Delete button clicked.

This will prevent the form from acting in a normal manner. You can then use table I/O on the Ok button clicked to insert records followed by a Press button find.

You can also use table I/O to delete the selected records from the grid on the delete button clicked followed by a press button find.

Hope this helps
Aidy
 
Re: Can\'t make Headerless Detail features work

OK, I've tried a lot of things so far and am not making any real headway yet:

Header Detail form type seems to make no difference. Tried the Suppress Delete on button click, still only cycle thru the ER once. Tried checking the box for Process All Rows, with no difference.

I'm runnig the app in HTML mode. Does HTML disable multiple row processing?
 
Re: Can\'t make Headerless Detail features work

For the delete stuff, try some of the following:

- move code to grid's "Delete Grid Rec From DB - Before/After"
- if you keep code on the delete button go to "Options" and check "Repeat for Grid"

For the closing form on add if the other posters suggestion to uncheck "close form on add" doesnt work look at the system function "Set Save Behavior on OK" in the general sys func catagory. I have never used it but it looks promising.
 
Re: Can\'t make Headerless Detail features work

Bob

To be able to delete selected rows in the grid, there is a way.

On the grid properties, ensure hide row headers is unchecked.

Add a column to the grid using DD item EV01.

On Double click on row header event if EV01 = 0 or blank set EV01 = 1 (selected) At the same time set the Grid Row bitmap to a check mark.

On the same event, if EV01 = 1, set EV01 = 0 (unselected) At the same time set the Grid Row bitmap to a blank mark.

Now on the delete button clicked, you will need to walk the grid, one row at a time, if EV01 = 1 then it is selected, and a table I/O for the delete of the row can be performed.

Let me know if you want me to post some sample code as an example of this method.

Many thanks
Aidy
 
Re: Can\'t make Headerless Detail features work

I have my app working as desired. Had to give up on trying to make the "Repeat for Grid" work - it just does not operate as advertised.

BOster - Followed your suggestion concerning the OK button. In "Post Dialog Initialized" form ER, used Set Save Behavior on OK to <Save and Continue>. Then, in "All Grid Records Updated to DB" grid ER, used Press Button HC F&ind. This kept my form active and refreshed the grid to show updates.

For the delete issue, had to manually loop through the selected grid records myself. Code sample behind Button Clicked ER for &Delete button follows:

Get Selected Grid Row Count(FC Grid, VA frm_DelRowCount_INT01)
VA frm_DeleteCount_INT01 = "0"
Get Next Selected Row(FC Grid, <Before First Row>, VA frm_GridRowNum_INT01)
While VA frm_DeleteCount_INT01 is less than VA frm_SelRowCount_INT01
Get Grid Row(FC Grid, VA frm_GridRowNum_INT01)
F570001.Delete
VA frm_DeleteCount_INT01 = [VA frm_DeleteCount_INT01]+1
Get Next Selected Row(FC Grid, VA frm_GridRowNum_INT01, VA frm_GridRowNum_INT01)
End While

Thanks to everyone for the helpful suggestions!
 
Re: Can\'t make Headerless Detail features work

Nice one Bob

If you did want to make use of the Grid Row bitmap etc

On the grid properties, ensure hide row headers is unchecked.

Add a column to the grid using DD item EV01.

=======================================================================
CONTROL: GRID Grid
EVENT: Double Click on Row Header
-----------------------------------------------------------------------
0003 If GC 0/1 is equal to <Zero> Or GC 0/1 is equal to <Blank>
0004 GC J.D.Edwards Event Point 01 = "1"
0005 Set Grid Row Bitmap(FC Grid, <Currently Selected Row>, <Check Mark>)
0010 Else
0011 If GC 0/1 is equal to "1"
0012 GC J.D.Edwards Event Point 01 = "0"
0013 Set Grid Row Bitmap(FC Grid, <Currently Selected Row>, <Blank/Clear>)
0018 End If
0019 End If


=======================================================================
CONTROL: HYPITEM &DELETE
EVENT: Button Clicked
-----------------------------------------------------------------------
0002 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
0003 // Walk the grid, and if the row is selected, DELETE the record
0004 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
0011 Get Max Grid Rows(FC Grid, VA frm_mnMATH01_MaxGridRows)
0012 VA frm_mnMATH01_CurrentGridRow = VA frm_mnMATH01_MaxGridRows
0013 //
0014 While VA frm_mnMATH01_CurrentGridRow is greater than or equal to "1.00"
0015 //
0016 Get Grid Row(FC Grid, VA frm_mnMATH01_CurrentGridRow)
0017 //
0018 If GC 0/1 is equal to "1"
0020 Do your Table I/O Delete here passing in GC values
0027 End If
0030 //
0031 VA frm_mnMATH01_CurrentGridRow = VA frm_mnMATH01_CurrentGridRow-1
0032 End While
 
I have my app working as desired. Had to give up on trying to make the "Repeat for Grid" work - it just does not operate as advertised.

BOster - Followed your suggestion concerning the OK button. In "Post Dialog Initialized" form ER, used Set Save Behavior on OK to <Save and Continue>. Then, in "All Grid Records Updated to DB" grid ER, used Press Button HC F&ind. This kept my form active and refreshed the grid to show updates.

For the delete issue, had to manually loop through the selected grid records myself. Code sample behind Button Clicked ER for &Delete button follows:

Get Selected Grid Row Count(FC Grid, VA frm_DelRowCount_INT01)
VA frm_DeleteCount_INT01 = "0"
Get Next Selected Row(FC Grid, <Before First Row>, VA frm_GridRowNum_INT01)
While VA frm_DeleteCount_INT01 is less than VA frm_SelRowCount_INT01
Get Grid Row(FC Grid, VA frm_GridRowNum_INT01)
F570001.Delete
VA frm_DeleteCount_INT01 = [VA frm_DeleteCount_INT01]+1
Get Next Selected Row(FC Grid, VA frm_GridRowNum_INT01, VA frm_GridRowNum_INT01)
End While

Thanks to everyone for the helpful suggestions!

Thanks Bob your idea helped me today almost 6 years after you posted your method
 
Nice one Bob

If you did want to make use of the Grid Row bitmap etc

On the grid properties, ensure hide row headers is unchecked.

Add a column to the grid using DD item EV01.

=======================================================================
CONTROL: GRID Grid
EVENT: Double Click on Row Header
-----------------------------------------------------------------------
0003 If GC 0/1 is equal to <Zero> Or GC 0/1 is equal to <Blank>
0004 GC J.D.Edwards Event Point 01 = "1"
0005 Set Grid Row Bitmap(FC Grid, <Currently Selected Row>, <Check Mark>)
0010 Else
0011 If GC 0/1 is equal to "1"
0012 GC J.D.Edwards Event Point 01 = "0"
0013 Set Grid Row Bitmap(FC Grid, <Currently Selected Row>, <Blank/Clear>)
0018 End If
0019 End If


=======================================================================
CONTROL: HYPITEM &DELETE
EVENT: Button Clicked
-----------------------------------------------------------------------
0002 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
0003 // Walk the grid, and if the row is selected, DELETE the record
0004 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
0011 Get Max Grid Rows(FC Grid, VA frm_mnMATH01_MaxGridRows)
0012 VA frm_mnMATH01_CurrentGridRow = VA frm_mnMATH01_MaxGridRows
0013 //
0014 While VA frm_mnMATH01_CurrentGridRow is greater than or equal to "1.00"
0015 //
0016 Get Grid Row(FC Grid, VA frm_mnMATH01_CurrentGridRow)
0017 //
0018 If GC 0/1 is equal to "1"
0020 Do your Table I/O Delete here passing in GC values
0027 End If
0030 //
0031 VA frm_mnMATH01_CurrentGridRow = VA frm_mnMATH01_CurrentGridRow-1
0032 End While

Thanks Aidy your idea was also good, but used the idea from Bob B. But this one is nice to note for some other cases.
 
Back
Top