3 Replies Latest reply: Feb 7, 2013 11:37 AM by CraigB RSS

    is it possible

    750281
      hi,
      i am using 10g forms
      is it possible that in multi records block i want to use two different color and every alternate record should have different color.

      eg. two colors yellow and brown

      ist rec --yellow
      2nd -brown
      3rd --yellow
      4th brown and so on..

      thanks
        • 1. Re: is it possible
          CraigB
          Yes, this is possible by creating a Visual Attribute for each color you want to use then use the Set_Item_Instance_Property() built-in to assign the visual attribute to each item displayed in your multirecord block row. Unfortunately, you do have to set this each item displayed as there is no built-in to set the attribute for the entire row. I recomend you create a Forms Program Unit that takes the block name, row number and color as parameters to simplify your coding.

          Which trigger to use to set the color depends on when you want the colors to change. If you are displaying records from a table, the Post-Query trigger is probably the best place. If you want the color to change as you are creating records then using a When-New-Record-Instance or When-Create-Record triggers. If querying exits records as well as adding new, then you will need a combination of the two.

          Hope this helps.
          Craig...
          • 2. Re: is it possible
            750281
            thanks.. i have already done it up to some extent but as you specify rownum , is there anything in-built in form to get or to show row number in multi record block ?
            • 3. Re: is it possible
              CraigB
              is there anything in-built in form to get or to show row number in multi record block ?
              Yes, take a look at the Forms Help System on the following topics: SYSTEM.CURSOR_RECORD and SYSTEM.TRIGGER_RECORD. Also, if you look at the help for the Set_Item_Instance_Property built-in you will see that you can specify CURRENT_RECORD when you are calling this built-in on the block's current record.

              Craig...