2 Replies Latest reply: Nov 24, 2012 5:12 AM by DejanL RSS

    Master detail form

    DejanL
      Hi,
      I use Apex 4.1.0.00.32 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?
      Thanks

      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
          603257
          Hi,
          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
            DejanL
            I solve problem with access Apex_application.g_fXX values. Create validation type Function returning error text.
            Thanks /dev/null for your effort.