Adding Edits to prevent a Find/Browse Delete

Frosty the Coder

Legendary Poster
List,

W/in a custom F/B, over a master file, I want to prevent
DELETE from processing if there is transactional data
against that master row.

At first, I tried the F(s)-Suppress Delete, but it didn't
do what I wanted.

I ended up removing the DELETE button from the menu toolbar,
adding my own DELETE(2) button, and pressing DELETE w/in
the ER if no trx records exist. Did I have to approach it
this way, or was there an easier way that I am missing?

The appl then gives the "Are you Sure?" message to which
I can either OK or CANCEL. How do I check which was pressed?

I realize that I could add code to try to FETCH the deleted
record. It not being there would mean OK was pressed. I
just want to know if there is a better way....

TIA

Gene



Gene Piekarski, Jr

AS/400, B733, SP11.2, NT client
AS/400, B733, SP14, W2000 client
XE, SP15.1
 
Hi Gene,

1.) Which event have you issued "Suppress Delete" system function call? It definitly works only when it is issued in one of the DeleteGridRecVerify-Before event, the DeleteGridRecVerify-After event, or the DeleteGridRecFromDB-Before event. I have already used it this way with succes on Find/Browse form.

2.) Other solution is to "Disable/Enable" the standard Delete button in the "Row is Entered" Grid event.

My opinion is that the both togeteher the best solution:
1.) Disable/Enable is user friendly, because this shows to the user that deletion is not possible for the row.
2.) "Suppress Delete" will make safe the final solution. Imagine, user enter a row and this time this row hasn't any transaction child. The user go to have a lunch and come back, while somebody other already generated transaction for this row but this user still can delete this row. Was I able to explain it enough clear?

Please, let us know, how did you accomplish this task finaly. Thanks.

Regards,

Zoltán

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

1: I'd thrown the SUPPRESS DELETE w/in the &DELETE-Button Clicked.
2: It should go w/out saying that I'm putting (I've already put)
the logic as you've directed.

Thanks for your help, past, present, and future.

Gene



Gene Piekarski, Jr

AS/400, B733, SP11.2, NT client
AS/400, B733, SP14, W2000 client
XE, SP15.1
 
Back
Top