` Printed Icetips Article

Icetips Article



ABC: Stopping confirm delete message (C4)
1998-08-19 -- Wim Nijland
 
Newsgroups: topspeed.products.c4

>I'm looking into deleting records without the confirmation dialog.  I
>found the DeleteAction property of the WindowManager class, and the
>description appears to be what I want.  When I tried to use Delete:Auto
>it did not work as expected.

Ok, granted I'm not David, but I think the result of
CHOOSE(SELF.DeleteAction=Delete:Warn) becomes 1 if DeleteAction=Delete:Warn
or 0 otherwise. And this is correct.

What I did to avoid getting the confirmation dialog is the following:
In Global Embeds, goto Hide:Relate:File,
Then insert in method Delete PROCEDURE(Byte Query=1),
BEFORE the Parent Call
! Override of standard Delete
! No questions asked on delete of record
  Query = 0

This takes care of it, being a bit rude, because the question will never be
asked again.

It does work if you have a browse WITH an update procedure, but does work
the way you describe if the UPDATE procedure is not available, Am I right?

>I was looking through the source code in Abwindow.clw and found the
>following.
>
>WindowManager.PrimeUpdate PROCEDURE
>    CASE SELF.Request
>    of SELF.DeleteAction
>        CASE SELF.DeleteAction
>        OF Delete:Warn OROF Delete:Auto
>          SELF.Response =
>SELF.Primary.Delete(CHOOSE(SELF.DeleteAction=Delete:Warn))
>          SELF.Response =
>CHOOSE(SELF.Response=Level:Benign,RequestCompleted,RequestCancelled)
>          RVal = Level:Fatal
>        END
>
>I'm guessing that Delete:Auto doesn't work because the Case Statement
>doesn't distinguish between Delete:Warn and Delete:Auto.  I think the
>first Choose statement isn't complete. Should the statement read:
>
>        SELF.Response =
>SELF.Primary.Delete(CHOOSE(SELF.DeleteAction=Delete:Warn, Delete:Warn,
>Delete:Auto))
>
>?
>
>If I'm missing something else, please let me know.....
>
>This is my last problem in my first C4 ABC app.



Printed November 23, 2024, 2:12 am
This article has been viewed/printed 35439 times.
Google search has resulted in 59 hits on this article since January 25, 2004.