Alert firing several times [message #679198] |
Fri, 14 February 2020 13:00 |
buggleboy007
Messages: 282 Registered: November 2010 Location: Canada
|
Senior Member |
|
|
I have a form that has 2 blocks. Let's call the first block as .
This block has an id which when queried retrieves several transactional records from the second block called .
This CRITERIA block has a button called 'DESELECT' which deselects all the transactional records from WEB_CATALOGUES block. When it de-selects the records, let's say that there are 200 transnational records, then there is an alert that displays 200 times. I want it to be displayed only once irrespective of whether I select 1 record or 100 records. How can I ensure that the alert fires only once?
I followed the suggestions given in 'http://www.orafaq.com/forum/t/195560/', but that does not even fire an alert.
Here is the code that is present in 'DESELECT' button :
IF :CRITERIA.SITE_ID IS NULL THEN
rams$msg_ofg45('E', TRUE, '709304%1Web site');
END IF;
IF :WEB_CATALOGUES.STYLE_ID IS NULL OR :WEB_CATALOGUES.COLOR_ID IS NULL THEN
rams$msg_ofg45('E', TRUE, 720011);
END IF;
BEGIN
go_block('WEB_CATALOGUES');
first_record;
LOOP
:WEB_CATALOGUES.CHECK_IND :='N';
:WEB_CATALOGUES.DE_ACTIVATED_IND :='Y';
IF :system.last_record <> 'TRUE'
THEN
next_record;
ELSE
EXIT;
END IF;
END LOOP;
first_record;
END;
Then there is code at record level under WEB_CATALOGUES level:
DECLARE
alb NUMBER;
t_error_text varchar2(250);
v_result number;
BEGIN
IF :WEB_CATALOGUES.STYLE_ID IS NOT NULL THEN
IF :WEB_CATALOGUES.DISPLAY_FROM_DATE IS NULL THEN
rams$msg_alert('709304%1From Date','E',true);
END IF;
IF :WEB_CATALOGUES.DISPLAY_TO_DATE IS NULL THEN
rams$msg_alert('709304%1To Date','E',true);
END IF;
IF :WEB_CATALOGUES.CHECK_IND = 'N' AND :SYSTEM.RECORD_STATUS = 'INSERT' THEN
Set_Record_Property(get_block_property('WEB_CATALOGUES', CURRENT_RECORD), 'WEB_CATALOGUES', STATUS, QUERY_STATUS);
END IF;
IF :WEB_CATALOGUES.CHECK_IND = 'N' AND :SYSTEM.RECORD_STATUS = 'CHANGED' THEN
t_error_text:= lmsg.look_message(720004, :global.language_name);
set_alert_property('CG$ASK_COMMIT', alert_message_text, t_error_text);
alb := show_alert('CG$ASK_COMMIT'); --THIS IS THE ONE THAT IS FIRING SEVERAL TIMES
IF alb = alert_button1 THEN
NULL;
ELSIF alb = alert_button2 THEN
RAISE FORM_TRIGGER_FAILURE;
END IF;
END IF;
ELSE
rams$msg_ofg45('E', TRUE, 720011);
END IF;
END;
I commented the above and put this one in at block level (WEB_CATALOGUES), but the alert never even fired.
How can I resolve this issue?i.e. ensure that the user only sees this alert once (when he selects all the records). The alert message is: You are about to purge all the records? Continue...
|
|
|
|
|