2 Replies Latest reply: Aug 27, 2013 8:49 AM by CraigB RSS

    Disable a field of a detail block

    mustafa_yilmaz

      Hi. I am working on master-detail form.i want to disable my detail block field when execute.

      But no error no changes.Here is my code

       

      TRIGGER:POST-QUERY

       

      IF :XXTT_KONTRAT_LINES_V.TIP=2 THEN

        fnd_message.set_string('1');fnd_message.show();

      --SET_ITEM_INSTANCE_PROPERTY('XXTT_KONTRAT_LINES_V.SS_NO', CURRENT_RECORD, enabled, PROPERTY_true);

      SET_ITEM_INSTANCE_PROPERTY('XXTT_KONTRAT_LINES_V.SS_NO', CURRENT_RECORD, insert_allowed, PROPERTY_true);

      SET_ITEM_INSTANCE_PROPERTY('XXTT_KONTRAT_LINES_V.SS_NO', CURRENT_RECORD, update_allowed, PROPERTY_true);

      SET_ITEM_INSTANCE_PROPERTY('XXTT_KONTRAT_LINES_V.SS_NO', CURRENT_RECORD, NAVIGABLE, PROPERTY_true);

      else

        fnd_message.set_string('2');fnd_message.show();

      SET_ITEM_INSTANCE_PROPERTY('XXTT_KONTRAT_LINES_V.SS_NO', CURRENT_RECORD, insert_allowed, PROPERTY_false);

      SET_ITEM_INSTANCE_PROPERTY('XXTT_KONTRAT_LINES_V.SS_NO', CURRENT_RECORD, update_allowed, PROPERTY_false);

      END IF;

        • 1. Re: Disable a field of a detail block
          Su.gi

          Hi mustafa_yilmaz,

           

               You write the code in When-validate-record trigger in block level...dont use it in post-query..

           

          hope this will help..

          • 2. Re: Disable a field of a detail block
            CraigB

            mustafa_yilmaz wrote:

             

            Hi. I am working on master-detail form.i want to disable my detail block field when execute.

            ....
            --SET_ITEM_INSTANCE_PROPERTY('XXTT_KONTRAT_LINES_V.SS_NO', CURRENT_RECORD, enabled, PROPERTY_true);

            You can't ENABLE or DISABLE an item in a multi-row block using the Set_Item_Instance_Property() built-in.  Take a look at the Forms Help system on this built-in and you will find that you can only set the following properties using this built-in:  BORDER_BEVEL, INSERT_ALLOWED, NAVIGABLE, REQUIRED, UPDATE_ALLOWED, and VISUAL_ATTRIBUTE.

             

            In order to make a field in a multi-row block disabled, you have to emulate a disabled field.  In other words, you can set the INSERT/UPDATE_ALLOWED properties as you are doing and I would recommend you also set the NAVIGABLE property to FALSE in your ELSE clause as well.  If you need the field to appear as if it is disabled, then I recommend you create a set of visual attributes; one for a disabled field and one for an enabled field.  Something like: DISABLED_FIELD and ENABLED_FIELD.  Then you can use the Set_Item_Instance_Property() built-in to set the visual attribute in addition to the other properties you are setting.  This will give the field the appearance that it is disabled.

             

            Hope this helps.

            Craig...