Quick Delete & Delete Range confirmation technique?
Michael Lee
Michael.Lee@mclsystemsinc.com
Mon, 11 Dec 2000 09:22:44 -0800
Hi,
As far as I can see there is no way to do what you request-but you can 'cheat'
to get the same result. Instead of calling the delete procedure directly with
'delete' command on your menuitem-call a designer procedure instead. This
designer procedure will give the message as requested and then do a "PUSH
DELETE". The only fallback to this is if the user goes into expert mode. If
that is the case you'll have to set a flag in the designer procedure-which will
be read in the delete procedure (and subsequently reset). As well you would
have to create a designer procedure for the delete-range command as well.
Code (untested) would look something like this:
SCREEN TA020AQC ...
MENUITEM LABEL "DELETE ALL" ACTION DESIGNER DELETE
TEMP t_MESSAGE CHAR*50
TEMP t_PROMPT CHAR*01
TEMP t_DEL_OK CHAR*01 INITIAL "N"
FIELD t_MESSAGE NOID NOLABEL DISPLAY DATA AT 23,10
FIELD t_PROMPT NOID NOLABEL DISPLAY DATA AT 23,62
PROCEDURE DESIGNER DELETE
BEGIN
LET t_MESSAGE = "Are you sure you want to delete All?"
DISPLAY t_MESSAGE
ACCEPT t_PROMPT
IF t_PROMPT = 'Y'
THEN BEGIN
LET t_DEL_OK = 'Y'
PUSH DELETE
END
ELSE INFO="Delete cancelled."
LET t_MESSAGE = ' '
LET t_PROMPT = ' '
DISPLAY t_MESSAGE
DISPLAY t_PROMPT
END
PROCEDURE DELETE
BEGIN
IF t_DEL_OK = 'Y'
THEN BEGIN
FOR TIME_ATTEND_2
BEGIN
DELETE TIME_ATTEND_2
DELETE TIME_ATTEND
END
LET t_DEL_OK = "N"
END
END
I hope that helps.
Michael Lee
MCL Systems Inc.
GGrimm@pcc-structurals.com wrote:
> I want to allow both action commands "Delete" and "Delete Range",
> however, before actually deleting all the records on the Delete Action
> command, I need to prompt the screen user for assurance that is what
> they really wish to do. No warning is required for a Delete Range
> Action.
>
> Is there anyway to check which kind of Delete the user put in the
> Action?
>
> My screen has no detail file. Following is a snipet of the code.
>
> SCREEN TA020AQC RECEIVING PASSED_AREA AUTORETURN &
> MODE LABEL "Mode:" ACTION LABEL "Action:" FIELDMARK &
> HELP POPUP FROM 8,5 TO 20,75 ACTIONBAR ON LINE 1
> FILE TIME_ATTEND_2 PRIMARY OCCURS 13 NOITEMS CACHE 195
> ACCESS VIA EMPLOYEENO, ... etc.
> ACCESS VIA SHIFT_DATE, EMP_HOME_DEPT, ... etc.
>
> FILE TIME_ATTEND SECONDARY OCCURS WITH TIME_ATTEND_2 NOITEMS
> ACCESS VIA EMPLOYEENO, ... etc.
>
> = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
> Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
> This list is closed, thus to post to the list, you must be a subscriber.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.