Restrict insert,update and delete [message #413028] |
Tue, 14 July 2009 01:25 |
gozuhair
Messages: 206 Registered: January 2008
|
Senior Member |
|
|
Dear All
I have created a form that contains almost 10 blocks,In this form one of the block called ro_mst that contain column status and its type is check box and when user tick it then value Y is inserted otherwise value N is inserted , now i want to restrict my user that when user tick it/check it then record commit and all my form is locked and dont allow any thing means disable insert,update and delete except one column and its type is final_status and its in ro_mst block,please help
Regards
|
|
|
|
|
Re: Restrict insert,update and delete [message #413085 is a reply to message #413028] |
Tue, 14 July 2009 05:48 |
gozuhair
Messages: 206 Registered: January 2008
|
Senior Member |
|
|
Thanks for the reply.I have got the follwing code from Forms 6i help.
PROCEDURE Make_block_query_only
(blk_name IN VARCHAR2)
IS
blk_id BLOCK;
BEGIN
blk_id := Find_block(blk_name);
IF NOT Id_null(blk_id) THEN
Set_block_property(blk_id,insert_allowed,property_false);
Set_block_property(blk_id,update_allowed,property_false);
Set_block_property(blk_id,delete_allowed,property_false);
ELSE
Message('Block '
||blk_name
||' does not exist.');
RAISE form_trigger_failure;
END IF;
END;
I have changed the blk_name as per my block name like 'RO_MST' (Single quote included) but getting the compilation error.
PROCEDURE Make_block_query_only
('RO_MST' IN VARCHAR2)
IS
blk_id BLOCK;
BEGIN
blk_id := Find_block('RO_MST');
IF NOT Id_null(blk_id) THEN
Set_block_property(blk_id,insert_allowed,property_false);
Set_block_property(blk_id,update_allowed,property_false);
Set_block_property(blk_id,delete_allowed,property_false);
ELSE
Message('Block '
||blk_name
||' does not exist.');
RAISE form_trigger_failure;
END IF;
END;
Please also tell me that the above procedure is for only one block and should i need to define my all 10 block into this procedure,please help
Regards
|
|
|
|
|
Re: Restrict insert,update and delete [message #413109 is a reply to message #413028] |
Tue, 14 July 2009 07:18 |
cookiemonster
Messages: 13938 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
PROCEDURE Make_block_query_only
('RO_MST' IN VARCHAR2)
IS
That's not a valid parameter name is it?
If you want this code to only ever run for that block then lose the parameter as you don't need it. Otherwise pass the block name to the procedure in the code that calls it.
|
|
|
|
Re: Restrict insert,update and delete [message #414483 is a reply to message #413028] |
Wed, 22 July 2009 06:04 |
gozuhair
Messages: 206 Registered: January 2008
|
Senior Member |
|
|
Dear Sir
Please tell me one more thing,what is the ideal trigger name and level(form level,block level and item level ) to execute the above procedure.
I am using this procedure in when radio button check trigger but its not working fine,kindly advice.
|
|
|
|
Re: Restrict insert,update and delete [message #414747 is a reply to message #413028] |
Thu, 23 July 2009 06:38 |
gozuhair
Messages: 206 Registered: January 2008
|
Senior Member |
|
|
Dear Sir
i am using this procedure on when radio button change trigger but this procedure only work when i change the radio button and my requirement is that if system found radio button value 'C' in either mode normal or enter query mode then system will restrict user for insert ,update and delete.
Thanks in advance
|
|
|
Re: Restrict insert,update and delete [message #414758 is a reply to message #413028] |
Thu, 23 July 2009 07:17 |
blaxmi
Messages: 36 Registered: May 2008 Location: Hyderabad
|
Member |
|
|
If you can write the code in when_validate_item trigger at record group level it may work b'cos when_radio changed trigger will work only when radio changed.
check whether it will work or not
|
|
|
|
|
|
|