5 Replies Latest reply: Apr 2, 2013 10:41 AM by CraigB RSS

    enable/disable an item in the form based on another item

    Veena
      Hi All,

      I have developed a form 10g for oracle apps R12. In a tab canvas, I have to display multiple records from a database table. All the items are defined as not updatable. And an item has to be displayed as updatable based on another item value. I have used the following in post-query trigger at data block level.

      declare
      it_id Item;
      begin
      IF :SETUP.EDIT_LEVEL = 1 THEN
      it_id := Find_Item('CONFIG_VALUE');
      SET_ITEM_INSTANCE_PROPERTY(it_id,CURRENT_RECORD, UPDATE_ALLOWED, PROPERTY_TRUE);
      end IF;
      END;

      But it is not working. The form shows all items as not updatable.
      Please suggest.

      Thanks,
      Veena
        • 1. Re: enable/disable an item in the form based on another item
          HamidHelal
          Veena wrote:
          Hi All,

          I have developed a form 10g for oracle apps R12. In a tab canvas, I have to display multiple records from a database table. All the items are defined as not updatable. And an item has to be displayed as updatable based on another item value. I have used the following in post-query trigger at data block level.

          declare
          it_id Item;
          begin
          IF :SETUP.EDIT_LEVEL = 1 THEN
          it_id := Find_Item('CONFIG_VALUE');
          SET_ITEM_INSTANCE_PROPERTY(it_id,CURRENT_RECORD, UPDATE_ALLOWED, PROPERTY_TRUE);
          end IF;
          END;

          But it is not working. The form shows all items as not updatable.
          Please suggest.
          hI, Veena

          Write your code at WHEN-NEW-RECORD-INSANCE trigger at block level.

          Hope this works..

          Hamid


          Mark correct/helpful to help others to get right answer(s).*
          • 2. Re: enable/disable an item in the form based on another item
            Veena
            hi Hamid,

            I have tried in when-new-record-instance trigger, but it's not working too.

            I have set the item property as updatable and then tried when-new-record-instance trigger to make it not updatable. This was partially working by disabling the item when i click on it, before that when i open the tab, the item is enabled.

            But this is not the expected behaviour I am looking for. I need the items meeting the required condition to be enabled as soon as the form is opened and other items as disabled.

            Please suggest how to proceed further.

            Thanks,
            Veena
            • 3. Re: enable/disable an item in the form based on another item
              HamidHelal
              Hi Veena,
              Veena wrote:
              hi Hamid,

              I have tried in when-new-record-instance trigger, but it's not working too.
              NO. Its working for only the current record. Other record are remain as the default behavior.
              >
              I have set the item property as updatable and then tried when-new-record-instance trigger to make it not updatable. This was partially working by disabling the item when i click on it, before that when i open the tab, the item is enabled.
              Yes your r right. What you can ?
              Set the item property not updatable. and just make it updatable/not updatable for current record at when-new-record-instance.
              But this is not the expected behaviour I am looking for. I need the items meeting the required condition to be enabled as soon as the form is opened and other items as disabled.
              If so, you want it at soon as form is open the take when-new-form instance trigger at form level and run a loop at the block at set the desired property.

              Hope this helps



              Hamid

              Mark correct/helpful to help others to get right answer(s).*
              • 4. Re: enable/disable an item in the form based on another item
                indra budiantho
                SET_ITEM_INSTANCE_PROPERTY('BLOCK.ITEM',CURRENT_RECORD, UPDATE_ALLOWED, PROPERTY_FALSE);

                and make sure :SETUP.EDIT_LEVEL = 1 is correct
                • 5. Re: enable/disable an item in the form based on another item
                  CraigB
                  IF :SETUP.EDIT_LEVEL = 1 THEN
                  How is the value of SETUP.EDIT_LEVEL set? Is it part of each record in your multi-record block or is it set by some other logic in your Post-Query (or other) trigger? What is the default value of SETUP.EDIT_LEVEL? If the default value is 0 and you don't have logic that changes the value or the value is not unique for each record displayed, then what you are seeing is expected.

                  Craig...