2 Replies Latest reply on Mar 20, 2013 9:51 AM by HamidHelal

    Query on child block is pulling records irrespective of the header block

      We have a scenario with
      1) one header block H1
      2) and 3 child blocks - b1, b2 an b3 out of which 3 tabbed regions are formed.
      3) b1 and b2 are child of h1 and
      4) b3 is child of b1

      All the blocks have enforce primary key set to yes and one of the columns identified as primary key. On the Database level , there existrs primary key and foreign key constraints are maintained

      If I take my cursor into child block b1 and query it (F11 and Ctril +F 11) , all the records irrespective of the header block are getting displayed.
      (All the block and fields are build manually , and then the relationships established. )

      What was done...

      I tried to disable this functionality by putting the following piece of code first in KEY-ENTQRY and then in KEY-EXEQRY of B1 by raising a form trigger failure if all the item fields of H1 are null. (used both the triggers independently ...didnt use both of them together)

      IF( All th fields from H1 are null)
      message('Cannot query here');
      raise form_trigger_failure;
      end if;


      Am able to disable query and requery (Ctrl + F11) in the child block completely (which is not what is intended)
      If I go to header block , query on a header block field and then requery back..it is working (Both header and record blocks are coming) ...
      now if I go to B1 and query back, the child block is not pulling the associated relevant records of the header block

      Any thoughts on how this functionality be achieved - so that parity between master and child can be maintained.