1 Reply Latest reply: Aug 27, 2013 9:11 AM by CraigB RSS

    Populating Master-Detail Block Data upon selection of LOV value

    Pavan 909

      Hi Everyone,

       

      I have a requirement to in Forms, where i need inputs. I used Oracle forms 10g.

       

      I have a LOV in control block, user has to select a value from the LOV and immediately upon selecting the LOV i do have to populate the details in master detail block below based on the selected LOV value.,

       

      I tried Post-Text-Item trigger to write code to populate the logic, but it says GO_BLOCK is restricted in Post-Text Item Trigger.

       

      Please suggest if there is any alternative to this logic.

       

      Thanks,

      Pavan

        • 1. Re: Populating Master-Detail Block Data upon selection of LOV value
          CraigB

          Create a Key-ListVal trigger on your item that displays the LOV for you.  The trigger will pause execution while the LOV is displayed.  Once the user has selected a value from the LOV the trigger will continue executing where it left off.  This will allow you to set the Master block's WHERE clause based on the value selected from the LOV and allow you to go to the block and execute the query.  Your code will look something like the following:

           

           

          /* Sample Key-ListVal Trigger */
           BEGIN
            List_Values;
            IF ( :YOUR_BLOCK.YOUR_ITEM IS NOT NULL ) THEN 
            G0_Block('Your_Master_Block');
            Execute_Query;
            END IF;
           END;
           
          

           

          This code sample assumes that you have already set the Default WHERE clause of your Master block and that your Master block has a relationship created between it and your Detail blocks.  If you have not set the default where property of your master block, then you will need to set it in the block properties or set it programatically using the Set_Block_Property() built-in.

           

          Hope this helps,

          Craig...