Use this alert and example for a for loop :
SET_ALERT_PROPERTY('ALT_TWO',ALERT_MESSAGE_TEXT,'Do you want to Send Requisition ?');
V_ALERT:=SHOW_ALERT('ALT_TWO');
PICTURE
IF V_ALERT=ALERT_BUTTON1 THEN
GO_BLOCK('SRV_REQUISITION');
LAST_RECORD;
IF :SRV_REQUISITION.TEST_NO IS NULL THEN
DELETE_RECORD;
END IF;
V_TEST_COUNT:=:SYSTEM.CURSOR_RECORD;
FIRST_RECORD;
FOR I IN 1..V_TEST_COUNT LOOP
IF :SRV_REQUISITION.TEST_NO IS NOT NULL THEN
--MSGBOX(:SRV_REQUISITION.TEST_NO);
LIST_TEST(I) :=:SRV_REQUISITION.TEST_NO;
LIST_TEST_QTY(I) :=NVL(:SRV_REQUISITION.QUANTITY,1) ; --:CTRL_INVESTIGATIONINFO.QTY;
LIST_STATUS(I) :=:SRV_REQUISITION.DELIVERY_STATUS; --:CTRL_INVESTIGATIONINFO.DELIVERY_STATUS;
LIST_SERVICE(I) :=:SRV_REQUISITION.TEST_TYPE;
LIST_REMARKS(I) :=:SRV_REQUISITION.REMARKS; --:CTRL_INVESTIGATIONINFO.REMARKS;
LIST_TEST_AMT(I) :=:SRV_REQUISITION.RATE;
LIST_INSTRUCTION(I) :=:SRV_REQUISITION.INSTRUCTION;
LIST_SAMPLE(I) :=:SRV_REQUISITION.SAMPLE_ID;
LIST_DELIVERY_DT(I) :=SYSDATE;
-- LIST_BILL_TYPE(I) :=0; --HOLDS BILL TYPE
LIST_LETTER_NO(I) :=:CTRL_CCPATIENT.REF_LETTERNO;
LIST_DISC(I) :=NULL;
LIST_DISC_AMT(I) :=0; --HOLDS TEST'S DISCOUNT AMOUNT
LIST_VAT_AMT(I) :=0; --HOLDS TEST'S VAT AMOUT
LIST_DX_RX_NO(I) :='';
--GRANT_DISCAMT :=0; --HOLDS TEST'S DISCOUNT TOTAL AMOUNT
--LIST_CLNT_ID(I) :=NVL(:CTRL_CASHPOINT.CLIENT,1);---1 FRO SERVICE PROVIDER
LIST_RATEGRP(I) :=NVL(:CTRL_CASHPOINT.RATE_GROUP,1) ;
IF :CTRL_CCPATIENT.REF_LETTERNO is not null then
LIST_BILL_TYPE(I):=1;--- IF IT IS CORPORATE NEED NOT TO PAY
LIST_PATPAY(I) :='N';
LIST_CLNT_ID(I) :=:CTRL_CCPATIENT.CLNT_ID;
ELSE
LIST_BILL_TYPE(I):=0;
LIST_PATPAY(I) :='Y';
LIST_CLNT_ID(I) :=1;
END IF;
-- V_CHECKEXIST:=V_CHECKEXIST+1;
NEXT_RECORD;
ELSE
NEXT_RECORD;
END IF;
END LOOP;
SET_ALERT_PROPERTY('ALT_TWO',ALERT_MESSAGE_TEXT,'Do you want to Send Requisition ?');
V_ALERT:=SHOW_ALERT('ALT_TWO');
PICTURE
IF V_ALERT=ALERT_BUTTON1 THEN
GO_BLOCK('SRV_REQUISITION');
LAST_RECORD;
IF :SRV_REQUISITION.TEST_NO IS NULL THEN
DELETE_RECORD;
END IF;
V_TEST_COUNT:=:SYSTEM.CURSOR_RECORD;
FIRST_RECORD;
FOR I IN 1..V_TEST_COUNT LOOP
IF :SRV_REQUISITION.TEST_NO IS NOT NULL THEN
--MSGBOX(:SRV_REQUISITION.TEST_NO);
LIST_TEST(I) :=:SRV_REQUISITION.TEST_NO;
LIST_TEST_QTY(I) :=NVL(:SRV_REQUISITION.QUANTITY,1) ; --:CTRL_INVESTIGATIONINFO.QTY;
LIST_STATUS(I) :=:SRV_REQUISITION.DELIVERY_STATUS; --:CTRL_INVESTIGATIONINFO.DELIVERY_STATUS;
LIST_SERVICE(I) :=:SRV_REQUISITION.TEST_TYPE;
LIST_REMARKS(I) :=:SRV_REQUISITION.REMARKS; --:CTRL_INVESTIGATIONINFO.REMARKS;
LIST_TEST_AMT(I) :=:SRV_REQUISITION.RATE;
LIST_INSTRUCTION(I) :=:SRV_REQUISITION.INSTRUCTION;
LIST_SAMPLE(I) :=:SRV_REQUISITION.SAMPLE_ID;
LIST_DELIVERY_DT(I) :=SYSDATE;
-- LIST_BILL_TYPE(I) :=0; --HOLDS BILL TYPE
LIST_LETTER_NO(I) :=:CTRL_CCPATIENT.REF_LETTERNO;
LIST_DISC(I) :=NULL;
LIST_DISC_AMT(I) :=0; --HOLDS TEST'S DISCOUNT AMOUNT
LIST_VAT_AMT(I) :=0; --HOLDS TEST'S VAT AMOUT
LIST_DX_RX_NO(I) :='';
--GRANT_DISCAMT :=0; --HOLDS TEST'S DISCOUNT TOTAL AMOUNT
--LIST_CLNT_ID(I) :=NVL(:CTRL_CASHPOINT.CLIENT,1);---1 FRO SERVICE PROVIDER
LIST_RATEGRP(I) :=NVL(:CTRL_CASHPOINT.RATE_GROUP,1) ;
IF :CTRL_CCPATIENT.REF_LETTERNO is not null then
LIST_BILL_TYPE(I):=1;--- IF IT IS CORPORATE NEED NOT TO PAY
LIST_PATPAY(I) :='N';
LIST_CLNT_ID(I) :=:CTRL_CCPATIENT.CLNT_ID;
ELSE
LIST_BILL_TYPE(I):=0;
LIST_PATPAY(I) :='Y';
LIST_CLNT_ID(I) :=1;
END IF;
-- V_CHECKEXIST:=V_CHECKEXIST+1;
NEXT_RECORD;
ELSE
NEXT_RECORD;
END IF;
END LOOP;