3 Replies Latest reply: May 15, 2012 2:04 AM by Amatu Allah Neveen Ebrahim RSS

    How to handle Update, Insert in same multi-record CONTROL Blk - Help Please

    user483578
      Hi All,
      Need some help.. have spent some time on this and not working for me at all...Set_item_property doesn't work as I want :-(
      I have a multi-record CONTROL block.
      Once the data is queried, it will display the existing data. Say there are about 10 fields displayed on the block
      I want to modify only 4 fields out of this 10. Other fields should not allowed to update.
      But I want to allow to insert a new records as well to the table and save. (I am inserting manually through a package.)
      How do I handle this insert and modify functionality on the same form._
        • 1. Re: How to handle Update, Insert in same multi-record CONTROL Blk - Help Please
          CraigB
          First and foremost, you should always include the following minumum information: Forms version, OS version, Java version.

          How are you populating your datablock? It sounds like you are manually populating the block rather than basing the block on a table. Were your block based on the table, Oracle Forms will handle the all of the DML for you - no need to write code for this.
          I want to modify only 4 fields out of this 10. Other fields should not allowed to update.
          It sounds like you don't want your users to be able to update any of the remain 6 fields. This being the case, just set the Update Allowed property to No for each item in the Property Pallet - there is no need to change them programatically.

          If you feel you must set them programatically, then the Forms SET_ITEM_PROPERTY built-in is the wrong one to use. When you use this built-in it sets the property for ALL items in your multi-record display. To set the properties of one instance of a item in your multi-record block, you have to use the SET_ITEM_INSTANCE_PROPERTY built-in. Using this built-in you can set the UPDATE_ALLOWED property to PROPERTY_FALSE for each item.

          Hope this helps,
          Craig B-)

          If someone's response is helpful or correct, please mark it accordingly.
          • 2. Re: How to handle Update, Insert in same multi-record CONTROL Blk - Help Please
            user483578
            ThanX Craig,

            Under which trigger do we place this "SET_ITEM_INSTANCE_PROPERTY('" ... statements ..
            am usning 10g forms, 11g database
            • 3. Re: How to handle Update, Insert in same multi-record CONTROL Blk - Help Pl
              Amatu Allah Neveen Ebrahim
              Hi

              u can use...
               
              WHEN-CREATE_RECORD Trigger
              block-Level

              Regards,

              Amatu Allah