6 Replies Latest reply: May 22, 2012 7:47 AM by VC RSS

    tabular form validation

    jmniard
      hello,

      i work on apex Application Express 4.1.1.00.23
      I create a tabular form


      based on the following query
      select
      "ROWID",
      "RUBSRH_SHORTDESC",
      "FP01",
      "FP02",
      "FP03",
      "FP04",
      "FP05",
      "FP06",
      "FP07",
      "FP08",
      "FP09",
      "FP10",
      "FP11",
      "FP12",
      "RUBCALC"
      from "#OWNER#"."APEXFPSAISIE_VIEW"



      The columns "FP01","FP02","FP03","FP04","FP05","FP06","FP07","FP08","FP09","FP10","FP11",
      "FP12" are editable .

      I look for a validation that prevent user to submit/change data for specifics rows.
      The rows are identified by the column RUBCALC that return 1 for the row that the user can modified.
      and 0 for the others.

      best regards
      jean marc
        • 1. Re: tabular form validation
          jariola
          Hi,

          Maybe easiest way is add where condition to form query.
          WHERE RUBCALC = 1
          Then user can not see or update other rows in form.

          If user need see other rows, you can create separated report for that purpose

          Regards,
          Jari

          -----
          My Blog: http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0
          Twitter: http://www.twitter.com/jariolai
          • 2. Re: tabular form validation
            jmniard
            thanks jarola, for the moment i prefer to display all the rows in the same form.

            i try to create a validation

            - type : Function returning boolean

            - Validation Expression 1 :

            if :RUBCALC = 1 then
            return false;
            else
            return true;
            end if;

            - error message : user cannot enter data


            Associated Column : Validation is not with a column

            condition; When Button Pressed submit

            but i don't understand why this validation is never executed.

            best regards
            • 3. Re: tabular form validation
              VC
              jmniard wrote:
              thanks jarola, for the moment i prefer to display all the rows in the same form.

              i try to create a validation

              - type : Function returning boolean

              - Validation Expression 1 :

              if :RUBCALC = 1 then
              This syntax only works with APEX items but not the tabular forms columns.
              return false;
              else
              return true;
              end if;

              - error message : user cannot enter data


              Associated Column : Validation is not with a column

              condition; When Button Pressed submit

              but i don't understand why this validation is never executed.

              best regards
              There can be multiple rows that user will try to modify and at the same time the rows could be in your condition or not, so
              you need to loop through all rows that user is trying to modify and do your validation with in those set of rows.

              See this http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_app.htm#AEAPI215
              • 4. Re: tabular form validation
                jmniard
                i try to understand

                in Re: Apex 4.1: Working Example for Column Validation in Tabular Form
                they used
                if :SAL < 1500 then
                return 'Sal Value is under 1500';
                else
                return null;
                end if;

                i don't understand why my case is not the same
                • 5. Re: tabular form validation
                  jmniard
                  the validation process doesn't work if the column RUBCALC is not editable.
                  maybie a bug .
                  So i set the "test" column RUBCAL editable and i hide this column.
                  and it works ;-)
                  • 6. Re: tabular form validation
                    VC
                    Yes, You are right.

                    You can create a tabular form validation on column RUBCAL > with Validation Type: Item / Column in Expression 1 equals string literal in Expression 2 > and expression 2 will have '1'