2 Replies Latest reply on Nov 24, 2012 11:12 AM by DejanL

    Master detail form

      I use Apex and Oracle Database 11gR2.
      I create master detail form. In master form (Order) I have one field (Date closed order) who indicates that Order is closed.
      In detail form (Order item) I have field Date closed item who indicates date when single item is closed.
      How to create validation when all Date closed item is filled check if Date closed order is empty and display some message?

      Edited by: DejanL on Nov 19, 2012 12:31 AM

      Edited by: DejanL on Nov 19, 2012 12:31 AM
        • 1. Re: Master detail form
          You can use a validation along the lines of:

          SQL Exists:
          SELECT  NULL
            FROM  xx_order_lines xol,
                  xx_order_headers xoh
           WHERE  xoh.order_header_id = xol.order_header_id
              AND xoh.order_header_id = &order_header_id
              AND xol.closed_date IS NOT NULL
              AND xoh.closed_date IS NULL;
          Then within the vaildation you put the appropriate message.

          But - I'd be tempted to make it part of your update process - either as a trigger on the lines table (have to be a bit clever to stop it mutating), or within the process itself. Ie, do the update on the lines, if all lines are now closed then flag the header as closed.
          • 2. Re: Master detail form
            I solve problem with access Apex_application.g_fXX values. Create validation type Function returning error text.
            Thanks /dev/null for your effort.