Deleting Mutiple Grids Rows at One Time

parora

Well Known Member
Hi All,

On the Customer Ledger Inquiry Browse Form, P03B2002/W03B2002A:

1. The Grid Column Properties has the "Multiple Select" checked.

2. Behind the Delete Menu/Toolbar Exit, the Event Rules behind the Button Click Control has the "Repeat for Grid", under the Options menu bar, checked as well.

However, when I select multiple rows in the Customer Ledger Inquiry screen, it only ends up deleting the 1st row.

There is an Enhancement SAR #1741 requesting this functionality, i.e. deleting many rows at once, but I don't quite understand why it doesn't work now, based on the settings above.

Any guidance or assistance would be greatly appreciated.
 
Parora,

If you click on the grid in Design mode and go to ER, then you will see several events 'Delete Grid Rec ....'. In there you will see a lot of Suppress Delete commands. I would assume from your description, that the Suppress Delete command innappropriately applies once to all times through the event.

If you put it in debugger or drop an MDDebug in the Delete hyperexit AND in the Delete Grid Rec.... events you can know for sure. Let us know what you find out.

Ben again
 
Hi Ben,

Thanks for your response. When running it through the ER Debugger, here's what I noticed:

1. Delete Grid Rec Verify - Before is Called. Within this event "Suppress Delete" is never called.

2. Delete Grid Rec Verify - After is Called. This deletes Media Objects associated with the Invoice

3. Delete Grid Rec from DB - Before is Called.
a)The Suppress Delete is called
b)The BSFN B03B0011 is called which deletes the Invoice.
c)Press Button(HC F&ind) is called to refresh the results of P03B2002

It ends there. Based on this, do you have any further thoughts? What does the Suppress Delete Function actually do?

Thanks for your help
 
Parora,

Effectively the Suppress Delete function stops (suppresses) the Delete activities starting from where the function is encountered. What I 'believe' happens is that there is a delete flag that was set for each of the selected grid rows, and all of them are cleared when the function is encountered.

You will probably have to simulate the Delete function if you want the multiple grid rows deleted. The reason the Delete button "must" call the Suppress Delete function is because they are using a bsfn to perform the delete and when they try to delete something that is not there, an error will pop up.

You can create a hyper-exit and copy the code from the delete button events. You will have to create your own Delete Confirmation form and figure out where to put that code. And finally, you will have to use an if statement of some sort to avoid the logic after the Suppress Delete is encountered.

Remember that you are ultimately responsible for modifications that you make, and any suggestions by this list should be scrutinized very carefully as well as the modifications should be tested exhaustively. And when you test - don't test in order to prove the modification works - test to try and break your modification, then when you can't break it... your closer.

Ben again
 
I believe it is the FIND in step 3 that is causing the problem. It is refreshing the grid after the first delete. Try commenting out the Find (or shifting it to the "Post Button Clicked' event) and see if this helps.


Good Luck!
 
Ben and Michelle, thanks for your assistance on this.

Michelle, your suggestion about disabling the FIND in step 3 worked! I did readd this FIND to the event "ALL Grid Recs Deleted from DB", so that it still did the refresh after the deletion of all the selected records. Thanks.
 
Back
Top