--Procedure to lock
PROCEDURE P_block_record IS
v_CurrBlock block;
cur_blk varchar2(40) :=:System.Cursor_Block;
BEGIN
v_CurrBlock := Find_Block(cur_blk);
set_block_property(v_CurrBlock, update_allowed, property_false);
set_block_property(v_CurrBlock, delete_allowed, property_false);
EXCEPTION
WHEN others THEN
p_Message('Exception occured. Contact with Administrator');
END;
Call the above mentioned procedure on when-new-record-instance
-- Procedure to unlock
PROCEDURE P_UNBLOCK_RECORD IS
v_CurrBlock block;
cur_blk varchar2(40) :=:System.Cursor_Block;
BEGIN
v_CurrBlock := Find_Block(cur_blk);
set_block_property(v_CurrBlock, update_allowed, property_true);
set_block_property(v_CurrBlock, delete_allowed, property_true);
EXCEPTION
WHEN others THEN
p_Message('Exception occurred. Contact with Administrator');
END;
Call the above mentioned procedure to unlock on key-print or when you want
Create an alert named 'ask' 2 button yes/no.
Create the procedure on key-delrec for warning
DECLARE
nalertbutton NUMBER;
BEGIN
SET_ALERT_PROPERTY ('ask',
alert_message_text,
'You''re going to delete record, Confirm Yes or No?');
-- after below statement the execution will hold till you click on ok.. becuase it is an modal window
nalertbutton := SHOW_ALERT ('ask');
-- now check which button or answer have been choosen
IF nalertbutton = alert_button1
THEN
DELETE_RECORD;
ELSE
RAISE form_trigger_failure;
END IF;
-- after this you can perform any task...
END;
PROCEDURE P_block_record IS
v_CurrBlock block;
cur_blk varchar2(40) :=:System.Cursor_Block;
BEGIN
v_CurrBlock := Find_Block(cur_blk);
set_block_property(v_CurrBlock, update_allowed, property_false);
set_block_property(v_CurrBlock, delete_allowed, property_false);
EXCEPTION
WHEN others THEN
p_Message('Exception occured. Contact with Administrator');
END;
Call the above mentioned procedure on when-new-record-instance
-- Procedure to unlock
PROCEDURE P_UNBLOCK_RECORD IS
v_CurrBlock block;
cur_blk varchar2(40) :=:System.Cursor_Block;
BEGIN
v_CurrBlock := Find_Block(cur_blk);
set_block_property(v_CurrBlock, update_allowed, property_true);
set_block_property(v_CurrBlock, delete_allowed, property_true);
EXCEPTION
WHEN others THEN
p_Message('Exception occurred. Contact with Administrator');
END;
Call the above mentioned procedure to unlock on key-print or when you want
Create an alert named 'ask' 2 button yes/no.
Create the procedure on key-delrec for warning
DECLARE
nalertbutton NUMBER;
BEGIN
SET_ALERT_PROPERTY ('ask',
alert_message_text,
'You''re going to delete record, Confirm Yes or No?');
-- after below statement the execution will hold till you click on ok.. becuase it is an modal window
nalertbutton := SHOW_ALERT ('ask');
-- now check which button or answer have been choosen
IF nalertbutton = alert_button1
THEN
DELETE_RECORD;
ELSE
RAISE form_trigger_failure;
END IF;
-- after this you can perform any task...
END;

কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন