Doing validation on tabular form

hi
i have tabular form based on table which contains name_of_user varchar2(15)
the name of the user should be upper case.
i want when i'm pressing the add row button to check if this column (field) contains upper case. i do know that i need to relate to the tabular for as array
but i don't know how ?
my tabular form is select
"id","name_of_user" from owner."users"
how shell i relate this array and how shell i ask if it's upper case
note: i will be glad if you show me also a way to do it as a validation on table level
thanks

Writing validations for tabular form input is not very easy. You can try using some of the excellent work Patrick has done with this, details at http://inside-apex.blogspot.com/2006/12/plug-play-tabular-form-handling.html
Using out-of-the-box APEX, you would need to write a "PL/SQL function body returning error text" validation with a Error display location of "On error page" that does something like
declare
l_error varchar2(4000);
begin
for i in 1..apex_application.g_f02.count loop
   if (nvl(apex_application.g_f02(i),'~')  != upper(nvl(apex_application.g_f02(i),'~')) then
      l_error := l_error ||'< br/>'||'Row '||i||': Value must be upper case '||apex_application.g_f02(i);
   end if;
end loop;
return ltrim(l_error,'< br/>');
end;[Of course, substitute "f02" with the proper name of the array (unfortunately you need to look at the generate page HTML source to see what array is used to render your "name_of_user" column]

Similar Messages

  • Null Validation in Tabular Form in APEX 4.2.2

    Hi to all respected Gurus of this Forum!
    Recently downloaded APEX 4.2.2. As we know that this version has some improved features and one is the best is i.e. *"Validation on Tabular Form".*
    For test purpose I succeeded to apply validation on field of tabular form and I am not allowed to "SUBMIT" data as per Validation Rule.
    But now, I want to customize that validation as per below logic.
    If required field is null than a message-box should appear with two buttons , as under:
    Blank field not allowed. Do you really want to submit? (Buttons should be = YES NO)
    If user press "YES" then validation should be false and record should be saved
    AND
    If user press "NO" then no data should be submitted/inserted as per validation logic.
    Please help. Your as usual cooperation is highly appreciated in advance.
    Regards
    Muhammad Uzair Awan
    ORACLE APEX Developer
    Pakistan

    Hello Sabine,
    >> I read about enhanced validation in 4.1 and would love to get rid of g_f-programming.
    The major “trick” is to associate the validation/process with a Tabular Form. On the first screen of both wizards, the first field is Tabular Form. You must select the tabular form on your page (currently there can be only one. In future versions this will change).
    Another factor that might influence the behavior of Tabular Form validation/process is the new attribute of Execution Scope. Unfortunately, you must enter Edit mode to gain access to this attribute (i.e., it can’t be set directly from the Tabular Form create wizard). Set it according to your need.
    The rest is very simple. You should treat your Tabular Form as a simple form, where every column header stands for a form item. The following is a very simple example of validating the SAL column:
    if :SAL < 1500 then
      return 'Sal Value is under 1500';
    else
      return null;
    end if;In this validation I’m using the Function Returning Error Text type.
    Regards,
    Arie.
    &diams; Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
    &diams; Author of Oracle Application Express 3.2 – The Essentials and More

  • Across row validation in tabular form and across items in row validations.

    Hi,
    We are upgrading to APEX 4.0.
    I need to create a tabular form that will have a start date and an end date. FOr each new row or updated row I need ensure its start date is after the end date of all rows already entered and its end date is after the start date of row being entered. Also that if no end date is entered then no other rows can be found with a null end date.
    SO I need across field validations with in a row and across row validattions. That is I need rowset validations as well.
    Is it possible to do this with APEX? WHat kind of tabular solution would allow these type of validations. How might these validations be done?

    Okay, Here's a quick rundown on how to build a manual form using APEX_ITEM and collections. The process goes in 4 steps: gather the data, display the data, update based on user input, then write the changes. Each step requires it's own piece of code, but you can extend this out as far as you want. I have a complex form that has no less than a master table and 4 children I write to based on user input, so this can get as complex as you need. Let me know if anything doesn't make sense.
    First, create the basic dataset you are going to work with. This usually includes existing data + empty rows for input. Create a Procedure that fires BEFORE HEADER or AFTER HEADER but definitely BEFORE the first region.
    DECLARE
      v_id     NUMBER;
      var1     NUMBER;
      var2     NUMBER;
      var3     VARCHAR2(10);
      var4     VARCHAR2(8);
      cursor c_prepop is
      select KEY, col1, col2, col3, to_char(col4,'MMDDYYYY')
        from table1
        where ...;
      i         NUMBER;
      cntr      NUMBER := 5;  --sets the number of blank rows
    BEGIN
      OPEN c_prepop;
        LOOP
          FETCH c_prepop into v_id, var1, var2, var3, var4;
          EXIT WHEN c_prepop%NOTFOUND;
            APEX_COLLECTION.ADD_MEMBER(
            p_collection_name => 'MY_COLLECTION',
            p_c001 => v_id,  --Primary Key
            p_c002 => var1, --Number placeholder
            p_c003 => var2, --Number placeholder
            p_c004 => var3, --text placeholder
            p_c005 => var4 --Date placeholder
        END LOOP;
      CLOSE c_prepop;
      for i in 1..cntr loop
        APEX_COLLECTION.ADD_MEMBER(
            p_collection_name => 'MY_COLLECTION',
            p_c001 => 0, --designates this as a new record
            p_c002 => 0, --Number placeholder
            p_c003 => 0, --Number placeholder
            p_c004 => NULL, --text placeholder
            p_c005 => to_char(SYSDATE,'MMDDYYYY') --Date placeholder
      end loop;
    END;Now I have a collection populated with rows I can use. In this example I have 2 NUMBERS, a TEXT value, and a DATE value stored as text. Collections can't store DATE datatypes, so you have to cast it to text and play with it that way. The reason is because the user is going to see and manipulate text - not a DATE datatype.
    Now build the form/report region so your users can see/manipulate the data. Here is a sample query:
    SELECT rownum, apex_item.hidden(1, c001),  --Key ID
         apex_item.text(2, c002, 8, 8) VALUE1,
         apex_item.text(3, c003, 3, 3) VALUE2,
         apex_item.text(4, c004, 8, 8) VALUE3,
         apex_item.date_popup(5, null,c005,'MMDDYYYY',10,10) MY_DATE
    FROM APEX_COLLECTIONS
    WHERE COLLECTION_NAME = 'MY_COLLECTION'This will be a report just like an SQL report - you're just pulling the data from the collection. You can still apply the nice formatting, naming, sorting, etc. of a standard report. In the report the user will have 3 "text" values and one Date with Date Picker. You can change the format, just make sure to change it in all four procedures.
    What is critical to note here are the numbers that come right before the column names. These numbers become identifiers in the array used to capture the data. What APEX does is creates an array of up to 50 items it designates as F01-F50. The F is static, but the number following it corresponds to the number in your report declaration above, ie, F01 will contain the primary key value, F02 will contain the first numeric value, etc. While not strictly necessary, it is good practice to assign these values so you don't have to guess.
    One more note: I try to align the c00x values from the columns in the collection with the F0X values in the array to keep myself straight, but they are separate values that do NOT have to match. If you have an application you think might get expanded on, you can leave gaps wherever you want. Keep in mind, however, that you only have 50 array columns to use for data input. That's the limit of the F0X array even though a collection may have up to 1000 values.
    Now you need a way to capture user input. I like to create this as a BEFORE COMPUTATIONS/VALIDATIONS procedure that way the user can see what they changed (even if it is wrong). Use the Validations to catch mistakes.
    declare
      j pls_integer := 0;
    begin
    for j1 in (
      select seq_id from apex_collections
      where collection_name = 'MY_COLLECTION'
      order by seq_id) loop
      j := j+1;
      --VAL1 (number)
      apex_collection.update_member_attribute (p_collection_name=> 'MY_COLLECTION',
          p_seq=> j1.seq_id,p_attr_number =>2,p_attr_value=>wwv_flow.g_f02(j));
      --VAL2 (number)
      apex_collection.update_member_attribute (p_collection_name=> 'MY_COLLECTION',
          p_seq=> j1.seq_id,p_attr_number =>3,p_attr_value=>wwv_flow.g_f03(j));
      --VAL3 (text)
      apex_collection.update_member_attribute (p_collection_name=> 'MY_COLLECTION',
          p_seq=> j1.seq_id,p_attr_number =>4,p_attr_value=>wwv_flow.g_f04(j));
      --VAL4 (Date)
      apex_collection.update_member_attribute (p_collection_name=> 'MY_COLLECTION',
          p_seq=> j1.seq_id,p_attr_number =>5,p_attr_value=>wwv_flow.g_f05(j));
    end loop;
    end;Clear as mud? Walk through it slowly. The syntax tells APEX which Collection (p_collection_name), then which row (p_seq), then which column/attribute (p_attr_number) to update with which value (wwv_flow.g_f0X(j)). The attribute number is the column number from the collection without the "c" in front (ie c004 in the collection = attribute 4).
    The last one is your procedure to write the changes to the Database. This one should be a procedure that fires AFTER COMPUTATIONS AND VALIDATIONS. It uses that hidden KEY value to determine whether the row exists and needs to be updated, or new and needs to be inserted.
    declare
    begin
      --Get records from Collection
      for y in (select TO_NUMBER(c001) x_key, TO_NUMBER(c002) x_1,
                 TO_NUMBER(c003) x_2,
                 c004 x_3,
                 TO_DATE(c005,'MMDDYYYY') x_dt
               FROM APEX_COLLECTIONS
               WHERE COLLECTION_NAME = 'MY_COLLECTION') loop
        if y.x_key = 0 then  --New record
            insert into MY_TABLE (KEY_ID, COL1,
                COL2, COL3, COL4, COL5)
              values (SEQ_MY_TABLE.nextval, y.x_1,
                  y.x_2, y.x_3, y.x_4, y.x_dt);
        elsif y.x_key > 0 then  --Existing record
            update MY_TABLE set COL1=y.x_1, COL2=y.x_2,
                 COL3=y.x_3, COL4=y.x_4, COL5=y.x_dt
             where KEY_ID = y.x_key;
        else
          --THROW ERROR CONDITION
        end if;
      end loop;
    end;Now I usually include something to distinguish the empty new rows from the full new rows, but for simplicity I'm not including it here.
    Anyway, this works very well and allows me complete control over what I display on the screen and where all the data goes. I suggest using the APEX forms where you can, but for complex situations, this works nicely. Let me know if you need further clarifications.

  • Validation in Tabular form column

    Dear All,
    i am using tabular form (Apex 4.1) to create new project users.
    i want to apply validation on column of tabular form.
    i have multiple entry in tabular form .i want to iterate throuh all records to check validation but my code is not iterating in to all record of columns.
    where i doing wrong.
    my code is
    DECLARE
    D DATE;
    BEGIN
    SELECT START_DATE INTO D FROM PA_PROJECTS_ALL WHERE PROJECT_ID=:F104_RESOURCE;
    FOR i IN 1 .. apex_application.g_f09.COUNT
    LOOP
    IF apex_application.g_f09(i) >=D THEN
    RETURN TRUE;
    END IF;
    RETURN FALSE;
    END LOOP;
    END;How can i iterate my loop if 2 and 3 row record not satisfying this condition
    apex_application.g_f09(i) >=D .How can i do this.
    Thanks

    DECLARE
    D DATE;
    B  BOOLEAN := FALSE; -- Added
    BEGIN
    SELECT START_DATE INTO D FROM PA_PROJECTS_ALL WHERE PROJECT_ID=:F104_RESOURCE;
    FOR i IN 1 .. apex_application.g_f09.COUNT
    LOOP
    --IF TO_DATE(apex_application.g_f09(i)),'DD-MON'YYYY' >=TO_DATE(D,'DD-MON-YYYY') THEN
    IF TO_DATE(apex_application.g_f09(i)),'DD-MON-YYYY' >=TO_DATE(D,'DD-MON-YYYY') THEN -- removed syntax error in this line
      --RETURN TRUE;
       B := TRUE;
    END IF;
    --RETURN FALSE; --commented
    END LOOP;
    RETURN B;
    END;This will iterate through the entire array, and if even one time it runs B:= TRUE it will return TRUE.
    Now all this assuming that the above code is a Condition on the Validation. If it is the Validation itself then TRUE Means Passed and False means failed. Check whether that is what you want.
    Regards,
    h5. Contrariwise, if it was so, it might be; and if it were so, it would be; but as it isn't, it ain't. That's logic. --Lewis Carroll                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Validation On Tabular Form

    How to implement validation such on TABULAR FORM
    select case when
    lead (IHL_PDATE) over (order by IHL_PDATE) > IHL_PDATE
    OR
    lead (IHL_PDATE) over (order by IHL_PDATE) is null
    'Ok'
    else 'Not Ok'
    end
    after or before submitting form?*
    I implement it on Table but I want to apply it to form?
    Regards
    Edited by: Siyavus on Sep 14, 2009 2:19 PM
    Edited by: Siyavus on Sep 14, 2009 2:28 PM

    Siyavus,
    Is your validation on the base table or a collection? Denes Kubicek has a couple examples of tabular form validation here:
    http://apex.oracle.com/pls/otn/f?p=31517:41
    Regards,
    Dan
    http://danielmcghan.us
    http://www.skillbuilders.com
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • Duplicates Validation on Tabular Form

    I have a wizard built tabular form. This displays 2 pieces of information, Phase ID and Phase Description, which the user can either modify or they can add new records. At the database level, I have a unique constraint on Phase ID (even tho it's called Phase ID this is not the primary key). Right now, when the user tries to enter a duplicate Phase ID, they get taken to an error page with the ugly Oracle contraint violation error. What I'm trying to do is create a validation in APEX that checks for duplicates so I can throw a nice, friendly Inline Notification for the user. After searching this forum, I have tried differing variations of the following code:
    DECLARE
    vMatch NUMBER;
    vItem VARCHAR2(1);
    BEGIN
    FOR i IN 1.. HTMLDB_APPLICATION.G_F02.COUNT LOOP
    vItem := HTMLDB_APPLICATION.G_F03(i);
    SELECT COUNT(*) INTO vMatch FROM Phase where Phase_ID = vItem;
    IF vMatch > 1 THEN
    RETURN 'Phase ID must be unique.';
    ELSE
    RETURN '';
    END IF;
    END LOOP;
    END;
    Obviously I can't get this to work or I wouldn't be posting my question! Can anybody please help me tweak this to validate duplicate entries or point me in the right direction? Thank you very much!

    Which is holding Phase ID: G_F03 or G_F02? Assuming it's F_F03 and assuming the PLSQL you included in your post is in a "PLSQL Returning Error Text" validation...
    The code you have in your post is effectively only checking to see whether the first phase ID is unique because within your LOOP you have:
    IF vMatch > 1 THEN
    RETURN 'Phase ID must be unique.';
    ELSE
    RETURN '';
    END IF;
    So if the first phase id in your tabular form is not a duplicate the above returns '' (NULL) and your validation passes.
    Changing your code to the following should work:
    DECLARE
    vMatch NUMBER;
    vItem VARCHAR2(1);
    BEGIN
    FOR i IN 1.. HTMLDB_APPLICATION.G_F02.COUNT LOOP
    vItem := HTMLDB_APPLICATION.G_F03(i);
    SELECT COUNT(*) INTO vMatch FROM Phase where Phase_ID = vItem;
    IF vMatch > 1 THEN
    RETURN 'Phase ID must be unique.';
    END IF;
    END LOOP;
    RETURN '';
    END;
    Andy

  • Validation of tabular form clears all the entries in that form

    Hi all,
    I have master-details form, where I have created details using Apex collections. Now I added validations on that detail form and I am getting proper validation message, but the form itself clears the data for that record if it is the new record. Is there a way to do validation and keeps the data without clearing the form? Thanks.
    SHY

    Hi;
    After countless searches on google, I chanced upon a solution that works for 100% of all cases. it is to define a set focus function:
    function setFocus(cellID) {
    document.getElementById(cellID).focus();
    then call the function after the alert setting a timeout: the function is executed after the cell is exited and this sets focus back to cell.
    myVar = setTimeout("setFocus(vName)",1)
    Works on IE and FF. I found the solution on this page: http://bytes.com/topic/javascript/answers/147801-set-focus-after-showing-alert
    Thank all.

  • Tabular Form Validation: Comparing Two Columns vs Check Constraint

    What is the best approach for validating that one column needs to be greater than another column in a tabular form when attempting to save. (E.g. An effective date and expirey date column. The expirey date column >= effective date column)
    At the moment I have a check constraint on the two columns at the database level which is fine but it returns and passes up a pretty cryptic (from a business user perspective) unfriendly message to the user as follows:
    Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-02290: check constraint (IDMTC.ADDRESS_TYPE_CON) violated, update "IDMTC"."ADDRESS_TYPE" set "ID" = :b1, "CODE" = :b2, "NAME" = :b3, "LOV_SORT_ORDER" = :b4, "DESCRIPTION" = :b5, "EFFECTIVE_DATE" = :b6, "EXPIRY_DATE" = :b7 where "ID" = :p_pk_col
    Unable to process update.
    Is there a way to inject, detect and/or replace this with a friendlier business user message? I have confirmed that the "Unable to process update." text at the bottom below the MRU Internal routine error raised from my check constraint is the process error message for my Apply MRU process.
    I was hesitating going down a larger page level validation where I loop through the tabular form array and/or inject some client side Javascript.
    Any advice? Have I simply overlooked some tabular form options for validating using cross column values?
    Thanks,
    Jeff

    Jeff..Thanks for the response.
    However because I am working in a tabular form at design time I don't know which controls I can reference in a dynamic action, or custom Javascript routine other than selecting all elements in a column using JQuery, etc.
    I have decided to go with for the time being an approach I found here: doing validation on tabular form
    My code ended up looking something like and was entered into a page level validation as a PL/SQL function body returning error text.:
    DECLARE
    l_error VARCHAR2 (4000);
    BEGIN
    FOR i IN 1 .. apex_application.g_f02.COUNT
    LOOP
    --If Expiry date is older then effective date
    IF nvl(apex_application.g_f08 (i), to_date('31-DEC-9999', 'dd-mon-yyyy')) < apex_application.g_f07 (i) THEN
    l_error :=
    l_error
    || '</br>'
    || 'Row '
    || i
    || ': Expiry date must be greater than effective date '
    || ' for maintenance item name: '
    || apex_application.g_f03 (i);
    END IF;
    END LOOP;
    RETURN LTRIM (l_error, '</br>');
    END;
    I had been hoping with Apex 4+ that there was additional native functionality to do this type of validation or somehow be able to reference a column or control name instead of a generic array column so that my code was better self documenting.
    It works for now...but would love to revisit with maybe a cleaner client side solution that does the validation and highlights the invalid element since I still maintain data integrity at the db with the check constraint.
    Thanks,
    Jeff

  • Tabular Form Validation not working in tabular form APEX 4.0

    Hi,
    I am using APEX 4.0. I have a tabular form with Tabular form validation done with it.
    Item not null is the validation.. so if I dont type any value in the any of the fields in the tabular form and press the Submit button, the first time error is shown... but when I click the Submit button again, with still the empty rows the page is submitted.
    How to resolve this issue?
    Edited by: Suzi on Oct 5, 2010 11:13 AM

    Look at this thread - Re: Validations of tabular forms in 4.0

  • How to create validation only for created rows in tabular form

    Hi all,
    I have a simple question. Is it possible to create a validation for tabular form which will be fired only for created?
    There is a possibility in APEX 4.1 to choose two types of "*Execution scope*" first is "*For created and Modified Rows*" and second is "*All Submitted Rows*".
    Thanks in advance!
    Regards,
    Jiri

    Hello Jiri,
    >> Is it possible to create a validation for tabular form which will be fired only for created?
    You can still use the scope of For created and Modified Rows and use a PL/SQL Expression condition of:
    :APEX$ROW_STATUS = 'C'You also need to change Execute Condition to For Each Row .
    Hope it helps,
    Arie.
    Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.

  • Tabular form validation to restrict user

    Dear all,
    I want to apply the validation on tabular form for my inventory module and I want to restrict the user  that the received quantity of particular item should not be greater than  the P.O quantity
    For example
    In  P.O
    Item Qty
    A 20
    Received Quantity
    Item Qty
    A 21
    Or if items are received in two shipments like as following
    Item Qty
    A 10
    A 11
    I want to put the validation to restrict the user that he can’t save the item quantity more then ordered quantity weather is received partialy or all at once, but I do not understand how can i do that.
    I m using Apex 4 with Oracle 11G R2 on windows Server 2003.
    Please help
    Thanks
    Suhaib
    Edited by: suhaib ahmed on Jun 18, 2011 1:39 PM
    Edited by: suhaib ahmed on Jun 19, 2011 12:53 PM

    hi,
    Refer Denes Kubicek - Apex Solution:
    http://apex.oracle.com/pls/otn/f?p=31517:41:7446375838232779:::RP,::
    http://apex.oracle.com/pls/otn/f?p=31517:214:7446375838232779:::RP,::
    Thanks,
    Kartik Patel
    http://patelkartik.blogspot.com

  • Validation problem on tabular form APEX 4.2

    Hi,
    My APEX Version is 4.2.
    I have problem with validations on tabular forms, for example : I have a column who must be numeric... when I get a character it is controlled properly, but it removes my line of the screen and he writes in the table below:
    state error:
    ORA-01403: no data found
    ORA-06510: PL / SQL: exception defined by the user untreated
    I Haven't this problem with this application on APEX 4.0
    PS : the validation was automatically create by APEX
    Regards

    Thomas,
    Is this a standard APEX tabular form validation, or a custom PL/SQL based validation? It might be easiest to diagnose what's going on there, if you could replicate this issue on apex.oracle.com, and point us to an example.
    Thanks,
    Marc

  • Custom errors in tabular form

    Hi,
    I am getting oracle errors in a tabular form if entering some illegal values. For example i am getting below oracle error
    when giving an invalid date in a date field
    Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: Found invalid date value, please verify
    date format., insert into "PE_DIP"."CORRELATION_ELIGIBILITY"
    ( "ID", "CUSTOMER_ID", "SITE_ID", "EQUIPMENT_ID", "TERMINATION_ID", "CORRELATION_ELIGIBILITY", "LAST_MO
    DIFIED_BY", "LAST_MODIFIED_ON") values ( :b1, :b2, :b3, :b4, :b5, :b6, :b7, :b8)i just need the message
    Found invalid date value, please verify date formatand like this, for each errors i just need the error message and that will be dispalyed in the notification area and not in
    other page. Is this possible?. Plz help,
    Thanks,
    TJ

    Hi TJ,
    You could write a JavaScript function to do that for you. Just call it onChange or onBlur. I have the following javascript functions that I use. These display the error next to the item though, so you may need to play around with it to display it where you want it to. (Pls note: I have a few validation functions like the notNull one below that all call the setError function.)
    //This function checks to see if the object sent in is null and if so displays an error message
    //back to the user. This is useful when doing client side validations on tabular forms in APEX.
    //It takes in the ID of the object we want to do this check for and prints out an error
    //just after the cell where the error occurred.
    function notNull(object, errObj) {
    var val = $x(object).value;
    setError(object, (val == "" || val == null), "This field cannot be empty ", errObj);
    //Function to display an error in a tabular form. The error will be displayed next to the field associated
    //with the object parameter, using div tags. In addition to the object parameter, the function also takes in
    //the err object to use as id in the div tag, a boolean variable to indicate if there is an error and the error string
    //to display
    function setError(object, isErr, errStr, errObj) {
    //ensure you have the name for the error string to be displayed
    if (!errObj) {
    errObj = "err_".concat(object.id);
    //if there was a prior error displayed, first delete that, so we do not have duplicate messages shown
    $x_Remove(errObj);
    if (isErr) {
    if (!$x(errObj)) {
    $x_Style(object, 'border', '1px solid red');
    var errStr = ('<div name="err" id="').concat(errObj).concat('" style="color:red;">').concat(errStr).concat(' </div>');
    object.parentNode.innerHTML += errStr;
    $x("Back").focus();
    $x(object.id).focus();
    } else {
    $x_Style(object, 'border', "1px solid #C8C8C8");
    $x_Remove(errObj);
    In the report item attributes page, I call the above function as onBlur="notNull(this);" in the element attribute field.
    HTH,
    Chandini

  • Not null validaton in tabular form --Apex3.2

    Hi,
    i am working with apex_3.2.
    i am working on tabular form. I want to set validation on tabular form column , Column value cannot be null.How i can do this?
    Thanks & Regards
    Vedant.

    Vedant wrote:
    Hi,
    Thanks it is working. i Need some more help regarding this. I have set the validation on add row button. If i keep the particular field empty on which i have set the validation , and click on add row button, it clear to the complete record. value should not be clear when click on the add row button it just show the massage, Field (Active_FLG) )cannot be empty.
    Thanks & Regards
    VedantI am not clear; when do you trigger the validation? On submit? If yes, then it will not retain your session state values. What is the relationship between the ADD_ROW button and the validation?
    FYI, if you wish to retain session state values in the tabular form, you should be writing manual tabular form using collections. You will get good amount of information on manual tabular forms and collections in this forum and outside(google).
    BTW, if your question is answered, do not forget to mark the appropriate post as correct. It will help all of us in the forum.

  • V4.0 - Tabular form ORA-01445: cannot select ROWID from, or sample,

    Hi
    I'm creating a tabular form in version 4.0.
    The select is based on three tables all of which have primary keys, and the keys are selected, but every time I run the page I get the following error:-
    failed to parse SQL query:
    ORA-01445: cannot select ROWID from, or sample, a join view without a key-preserved table
    The query runs just fine in TOAD
    Any ideas?
    Thanks
    Mike
    select
    PRL.PERF_RATING_LINE_ID,
    PRL.PERF_RATING_LINE_ID PERF_RATING_LINE_ID_DISPLAY,
    PRL.BUSINESS_UNIT,
    PRL.EMPLID,
    ''''||PRL.REVIEW_YEAR REVIEW_YEAR,
    PRL.REVIEW_PERIOD,
    PRL.PERFORMANCE_SCORE,
    PRL.MODERATED_SCORE,
    PRL.HRM,
    PRL.COMMENTS,
    PBR.BU_DESC,
    ''''||PBR.DEPTID DEPTID,
    PBR.DEPT_DESC,
    PBR.EMPLOYEE_NAME,
    PBR.GRADE,
    PRL.SCORE_APPROVED_BY,
    PBR.TEMP_PERM,
    PBR.GENDER,
    PBR.JOB_START_DATE,
    decode(DECODE(SUBSTR(PBR.FLAG,1,5),'Job s',substr(PBR.FLAG,instr(PBR.FLAG,'~',1)+2,3)),
    'HIR','Hired','XFR','Transfer','REH','Rehire')||
    decode(SUBSTR(PBR.FLAG,1,30),'Job starts during period ~ XFR',' - '||substr(PBR.FLAG,instr(PBR.FLAG,'~',1,2)+2)) JOB_START_DETAILS,
    PBR.APPOINTMENT_DATE,
    SUBSTR(PBR.JOB_END_DETAILS,INSTR(PBR.JOB_END_DETAILS,'~',1,2)+2) JOB_END_DATE,
    SUBSTR(PBR.JOB_END_DETAILS,INSTR(PBR.JOB_END_DETAILS,'~',1,1)+2,INSTR(PBR.JOB_END_DETAILS,'~',1,2)-INSTR(PBR.JOB_END_DETAILS,'~',1,1)-2) REASON,
    PBR.JOB_GROUP,
    PBR.JOB_GROUP_DESC,
    PBR.JOBCODE,
    PBR.JOBCODE_DESC JOB_DESC,
    PBR.JOB_FAMILY,
    PBR.JOB_FAMILY_DESC,
    PBR.PBR_ID,
    MD.MGR_DEPT_ID
    from PERFORMANCE_BASE_REFRESH_V PBR,
    PERFORMANCE_RATING_LINE PRL,
    Y00_OPR_MGR_DEPT MD
    WHERE (PRL.BUSINESS_UNIT = PBR.BUSINESS_UNIT
    AND PRL.EMPLID = PBR.EMPLID
    AND PRL.REVIEW_YEAR = PBR.REVIEW_YEAR
    AND PRL.REVIEW_PERIOD = PBR.REVIEW_PERIOD)
    AND MD.OPRID = :APP_USER
    AND INSTR(':'||MD.DEPTS_MANAGED||':',':'||PBR.DEPTID||':') > 0
    AND MD.MGR_DEPT_ID > 0
    AND PBR.ADMIN_CENTRE IN
    (select c.deptid AC
    from [email protected] A,
    [email protected] C
    where A.ROWSECCLASS = C.ROWSECCLASS
    AND C.DEPTID != 'ZZZZ'
    and a.oprid = :APP_USER)
    AND (:P2210_BUSINESS_UNIT IS NULL
    OR PBR.BUSINESS_UNIT = :P2210_BUSINESS_UNIT)
    AND (:P2210_EMPLOYEE_NAME IS NULL
    OR INSTR(UPPER(PBR.EMPLOYEE_NAME),UPPER(:P2210_EMPLOYEE_NAME)) > 0)
    AND (:P2210_DEPARTMENT IS NULL
    OR PBR.DEPTID = :P2210_DEPARTMENT)
    AND (:P2210_PERFORMANCE_RATING IS NULL
    OR PBR.PERFORMANCE_SCORE = :P2210_PERFORMANCE_RATING)
    AND (:P2210_MODERATED_RATING IS NULL
    OR PBR.MODERATED_SCORE = :P2210_MODERATED_RATING)
    AND (:P2210_GRADE IS NULL
    OR PBR.GRADE = :P2210_GRADE)
    AND (:P2210_PERM_TEMP IS NULL
    OR PBR.TEMP_PERM = :P2210_PERM_TEMP)
    AND SUBSTR(NVL(PBR.JOB_END_DETAILS,'XXX'),1,3) NOT IN ('TER','TOC')
    AND PRL.SCORE_APPROVED_BY IS NULL

    Hi Marc,
    Thanks again for the quick reply and all the support the dev team is providing to us.
    Couple of question finally on this issue:
    - fixing the "copy page"/"copy validation" bug, our workaround - by making a page copy - we've found to use the standard validation on tabular form based on complex views will go away, right?
    - I made a sql trace when running the originally created tabular form page and I found the statement generated by the apex engine which gives the ORA-01446. Just wondering, would it be possible that apex is using the PK defined during the wizard instead of the rowid?
    - If not, would it be a possible enhancement request in the future to let the developer name the ROWID column optionally, and then apex will use that column as rowid instead of the ROWID? This can give flexibility for us as developers, in this case complex views (with instead of triggers) can be standard way supported. What I mean exactly is to create the above view in the testcase as follows (most of these cases there is always a base table in the view, and the rest of the tables are used as lookups, so I can pick up the desired ROWID in the view with an alias):
    CREATE OR REPLACE VIEW  CUSTOMER_ORDERS_V  AS
      SELECT cus.customer_id,
                cus.cust_last_name,
                cust_first_name,
                cus.cust_city,
                COUNT (ord.order_id) order_count,
                CUS.ROWID ROW_ID
           FROM demo_customers cus, demo_orders ord
          WHERE ord.customer_id(+) = cus.customer_id
       GROUP BY cus.customer_id,
                cus.cust_last_name,
                cust_first_name,
                cus.cust_city,
                CUS.ROWID;and then at design time, I could pick up the ROW_ID column as rowid, so all the rest of the functionality could work as working now on simple views and tables.
    What do you think on that?
    best regards,
    Peter

Maybe you are looking for

  • Unable to access vpn box internal address after vpn

    Hi all. My office network is protected by asa5510 firewall with vpn configured. When i vpn into my office network i could not access the firewall via the firewall's internal address using telnet etc even though i have already enable telnet. The firew

  • Convert from String to Long

    Hello Frineds I want to convert from String to Long. My String is like str="600 700 250 300" and I want to convert it to long and get the total value in to the long variable.like the total of str in long varible should be 1850. Thank You Nilesh Vasan

  • Upgrade Lessons

    Hello, We are evaluating a upgrade from XI 3.0 to PI 7.3 and are wondering if there have been any Case Studies / Lessons learnt in Upgrade Cycles? Migration is a easier approach but budget and a complex B2B landscape makes us want to go down the upgr

  • XI AND IDOC?

    Hello at all, i have a very important question, what are the differences between XI and IDOC? Generated XI an IDOC Data Format? Because i dont know what IDOC is in compared to XI? Many Thanks in advance.

  • [SOLVED] I'm lost halfway between systemctl and netctl in Wifi Setup

    I'm working through the wiki pages Wireless Setup, to wpa_supplicant, and now NetCtl for the past three days. My progression is not continuous--I've jumped around. I can get connected, but I'm not sure what's managing that connection. I'm lost. I'm s