Home » Developer & Programmer » Forms » Restrict insert,update and delete (Froms,6i,XP)
Restrict insert,update and delete [message #413028] Tue, 14 July 2009 01:25 Go to next message
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 #413040 is a reply to message #413028] Tue, 14 July 2009 01:42 Go to previous messageGo to next message
gozuhair
Messages: 206
Registered: January 2008
Senior Member
I am very very sorry ,My both columns are Radio button not check boxes and one more thing when some user reopen the form by using enter query mode then user cant insert,update and delete the record and when user try to insert new record then all restriction are disable.

[Updated on: Tue, 14 July 2009 01:49]

Report message to a moderator

Re: Restrict insert,update and delete [message #413053 is a reply to message #413040] Tue, 14 July 2009 03:37 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
SET_BLOCK_PROPERTY and SET_ITEM_PROPERTY are built-ins that can help. See Forms Online Help System to see what they offer. As both are unrestricted procedures, you can call them from any trigger.

Also, you might need to check record status (whether it is new, changed or something different). :SYSTEM.RECORD_STATUS is capable of doing that part of job. Also, review list of other system variables - perhaps you'll find something interesting.
Re: Restrict insert,update and delete [message #413085 is a reply to message #413028] Tue, 14 July 2009 05:48 Go to previous messageGo to next message
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 #413088 is a reply to message #413085] Tue, 14 July 2009 05:59 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
gozuhair wrote on Tue, 14 July 2009 12:48
(...) but getting the compilation error.
I don't know any mind reader here. Are we supposed to guess which error you got?

Quote:
should i need to define my all 10 block into this procedure
Probably, if you want to restrict access to all of these blocks.
Re: Restrict insert,update and delete [message #413094 is a reply to message #413028] Tue, 14 July 2009 06:19 Go to previous messageGo to next message
gozuhair
Messages: 206
Registered: January 2008
Senior Member
sorry forgot to tell the error,please find the attached file for error detail.
  • Attachment: error.jpg
    (Size: 61.79KB, Downloaded 147 times)
Re: Restrict insert,update and delete [message #413109 is a reply to message #413028] Tue, 14 July 2009 07:18 Go to previous messageGo to next message
cookiemonster
Messages: 12403
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 #414256 is a reply to message #413028] Tue, 21 July 2009 04:10 Go to previous messageGo to next message
gozuhair
Messages: 206
Registered: January 2008
Senior Member
Thanks its working,sorry for late reply
Re: Restrict insert,update and delete [message #414483 is a reply to message #413028] Wed, 22 July 2009 06:04 Go to previous messageGo to next message
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 #414667 is a reply to message #414483] Thu, 23 July 2009 02:35 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
You said "its type is check box", then use 'when-checkbox-changed'.

David
[EDITED by DJM: typo on trigger name]

[Updated on: Thu, 23 July 2009 23:21]

Report message to a moderator

Re: Restrict insert,update and delete [message #414747 is a reply to message #413028] Thu, 23 July 2009 06:38 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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
Re: Restrict insert,update and delete [message #414883 is a reply to message #414747] Thu, 23 July 2009 23:23 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Place your code in the 'when-new-record-instance' trigger so that if fires as you enter the record.

David
Re: Restrict insert,update and delete [message #414935 is a reply to message #413028] Fri, 24 July 2009 01:53 Go to previous messageGo to next message
gozuhair
Messages: 206
Registered: January 2008
Senior Member
thanks,i have checked my procedure in both trigger and its working fine in both suggested triggers.thank you very much for your help.
Re: Restrict insert,update and delete [message #414936 is a reply to message #413028] Fri, 24 July 2009 01:56 Go to previous messageGo to next message
blaxmi
Messages: 36
Registered: May 2008
Location: Hyderabad
Member
Oh it's good. Did you write the code in when_validate_item and when_new_record instance triggers?
Re: Restrict insert,update and delete [message #415111 is a reply to message #413028] Fri, 24 July 2009 23:29 Go to previous message
gozuhair
Messages: 206
Registered: January 2008
Senior Member
I have written this code in
when new record instance
trigger on block level.Thanks for all for assist me.

Regards
Previous Topic: Is Oracle Forms supported for IE8
Next Topic: where i can download full version of developer suite 10G(10.1...)
Goto Forum:
  


Current Time: Sat Dec 03 10:10:08 CST 2016

Total time taken to generate the page: 0.10185 seconds