Page item validation

I created a page in APEX Express 4.2.3.00.08.  On the page there are two items: a text field named P55_KEY_ID and an LOV named P55_REASON with the values LOST, BROKEN, OTHER.  I created a dynamic action that enables P55_REASON when P55_KEY_ID changes. Our business rule is if P55_KEY_ID has been changed then P55_REASON must have a value, i.e. not null.  Can I define a validation on P55_REASON  with a condition to test the disabled property of the page item with javascript, if it is disabled then return false otherwise true.  Where would I place the following javascript?
IF $x(‘P55_REASON’).disabled then
  Return  false;
Else
Return true;
End if;

What is the validation? What version are you in?
There are some item validations that execute automatically based on settings like 'Required'.
Date pickers has other attributes that can declaratively validate range.

Similar Messages

  • Page item validation does not get removed

    Hi All,
         I had a page item validation defined on the page and later removed by deleting the validation in the 'page processing' in Application Builder. However, the validation still seems to execute at runtime. Can anyone tell me if it needs to be deleted from some other place as well.
    Thanks

    What is the validation? What version are you in?
    There are some item validations that execute automatically based on settings like 'Required'.
    Date pickers has other attributes that can declaratively validate range.

  • Apexlib page item validation not shown correctly

    Good morning guys! I have a question concerning the Apexlib page item validations.
    Basically I just want to validate page item values and have errors displayed in a notification region on the very same page on submit.
    I set up the Apexlib, which works perfectly for reports. However, when it comes to the page item validations, I am always rerouted to the Oracle Error page.
    Do you know why or have you experienced similar problems?
    Here is a part of the debug code when the error page is initialized.
    Processing point: ON_SUBMIT_BEFORE_COMPUTATION
    0.03: ...Process "ApplyMRU": MULTI_ROW_UPDATE (ON_SUBMIT_BEFORE_COMPUTATION) #OWNER#:VT_TBL_TOTHOLZ:CNT_TOTHOLZ
    0.04: Branch point: BEFORE_COMPUTATION
    0.04: Computation point: AFTER_SUBMIT
    0.04: Tabs: Perform Branching for Tab Requests
    0.04: Branch point: BEFORE_VALIDATION
    0.04: Perform validations:
    0.04: Branch point: BEFORE_PROCESSING
    0.04: Processing point: AFTER_SUBMIT
    0.04: ...Process "ApexLib-Before Computation/Validation": PLSQL (AFTER_SUBMIT) BEGIN ApexLib_Lov.clearLovNullValues; ApexLib_Item.validateItems; ApexLib_TabForm.validateColumns; -- ApexLib_Error.showErrorStack; END;
    0.06: Show ERROR page...
    If you have an idea please be so kind as to let me know!
    Many thanks,
    Seb

    Hi Peter!
    Thanks for having a look!
    I am using Apex 3.2 and Apexlib 1.6!
    Like I said, the report validations are functioning properly! It's just the error message is not displayed on the same page in a notification field. Instead the user is redirected to the original Apex Error Page when the error is caught.
    What validation do I want to carry out?
    I tried to verify the input of a text box with $APEXLIB_MAX_VALUE=10$.
    I thought it might be a minor problem, which I couldn't find. Already checked the installation of Apexlib twice. Seems to be alright.
    Best regards,
    Seb
    PS: Have a splendid WE

  • Regular Expression as page item

    Hello,
    I´m doing a page item validation using Regular Expressions, but my Regular Expression is Dynamic. I have another page item called VL_REGEXP where I set a value of regular expression.
    But, when I write VL_REGEXP as validation expression, it doesn´t test the condition. It only tests when I put the value of the regular expression.
    So, what would I do to pass this Dynamic Regular Expression for validation?
    Example of my settings:
    -- It doesn´t work
    Type of validation:
    Item / Column in expression 1 matches Regular Expression in Expression 2
    Expression 1
    P12_CD_ACCOUNT
    Expression 2
    P12_VL_REGEXP   -- this is what i need!
    -- It works
    Type of validation:
    Item / Column in expression 1 matches Regular Expression in Expression 2
    Expression 1
    P12_CD_ACCOUNT
    Expression 2
    ^(\d\d\.\d\d\d\.\d)+$
    thanks
    Bsalvador

    Not sure if the required substitution processing is supported in the validation expression, but if it is you need to reference the page item using the static text substitution syntax:
    Type of validation:
    Item / Column in expression 1 matches Regular Expression in Expression 2
    Expression 1
    P12_CD_ACCOUNT
    Expression 2
    &P12_VL_REGEXP.

  • Mandatory item validation at a page level?

    Hi,
    We have a page where the list of mandatory items changes according to how some 'key' items are set by the user e.g. if they select option 1 on item 1 we need a different set of mandatory fields than if they set option 2 - setting option 1 in item 4, may imply that some further items are mandatory, In addition, some items become mandatory due to circumstances known only on the database. We have in excess of 40 items on this page. Once all mandatory items are complete, the status of the page is saved as 'complete' - the user can always save the page as 'incomplete'.
    We already have a database package that can check a table row to see if it is 'complete', it knows all the circumstances for when an items becomes mandatory and can produce a list of fields and the reasons why they have failed validation.
    Is it possible to call this db package during page validation and use it to perform 'item' validations i.e. identify the invalid items and place the appropriate message inline with them?

    Hi,
    You can create a pl/sql page validation where you call you procedure.
    begin
    package_k.proc_p(item1,item2,...,itemN);
    end;
    You should define the type of the validation, but it is very straight forward,
    Regards,
    Max.

  • Item Level & Page Level Validation..

    Hi ,
    What is the difference between Item Level validation & Page Level validation..
    in which sceneario it will be useful.
    Anoo..
    Edited by: Anoo on Dec 16, 2008 5:04 AM

    Hi,
    From the APEX help:
    * Item level validations are specific to a single item.
    * Page level validations do not apply to any single item, but apply to an entire page.
    {code}
    Paulo Vale
    [http://apex-notes.blogspot.com]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Item & page level validation

    1. How do I check/see if a validation rule is page level or item level, I couldn't find any difference in the definitions between the two as seen on the definition screens in APEX.
    2. (Could be related to 1.) I expected the validation rule 'Item in Expression1 contains at least one of the characters in Expression2' to imply that Expression1 can not be NULL. I had to create a separate IS NOT NULL validation rule however. To me that does not make sense or is there a reasonable explanation?
    tia,
    Martin

    Martin,
    As Tony said, there is no difference between page and item validations other than the ability for item validations to have error messages positioned right next to their label.
    As for the null value problem, the following "item comparison" -type validations do not produce a validation error if the specified item is null:
    * Item specified contains no spaces
    * Item specified is a valid date
    * Item in Expression 1 contains only characters in Expression 2
    * Item in Expression 1 contains at least one of the characters in Expression 2
    * Item in Expression 1 does not contain any of the characters in Expression 2
    This allows you to account for the null value case with a separate "not null" validation. Without this behavior there would have to be a "Item in Expression 1 is NULL OR <remainder of validation>" -type validation in addition to each of the above validation types.
    However, the following validation types do result in a validation failure if the item is null:
    * Item in Expression 1 equals string literal in Expression 2
    * Item in Expression 1 is contained in Expression 2
    This behavior appears to be an oversight, also spelled bug.
    Scott

  • Button condition on page item and Validation error Conflict

    Hi,
    I have a select list page item and a button on page whose condition is based on the select list page item value(eg, If (:P2_item1='val1'){return true;}) with condition type=PL/SQL function returning boolean. This buttons submits the page.
    It' coming fine in normal case. However, if I select some value val2 from the list and then click the button, and if there are any validation errors (like mandatory check or email check fail etc), then the button disappears because it evaluates the button condition based on the changed value(val2), but the page has not yet been submitted because of validation errors.
    I think this can be solved if I create the button condition based upon database column value instead of page item as db col value won't change until the page is submitted.
    This look like very basic use-case and I would like to know if there is any better solution to this problem.
    Note: I am using Apex 4.2.1

    I don't want to show/hide the button on the change of the page item lov value, so i am not using Dynamic action.
    What i was is to make button visible based on a condition(which is based on page item), for which we have condition attribute of a button available.
    This is a very common thing where a user chooses the button condition as Value of item/column in expression 1 is null/expr2. But what if the user changes the page item value but it doesn't get submit due to validation error. In that case, the button condition fails.
    So, i guess i have to use column name in expression 1, can u tell how to do that?
    Expression 1 = IF (:P2_STATUS='val1') then return true;
    How to change the above to use db column 'status' instead? Any direct way(like #Status#) or I have to query db to get it using select.
    Any alternative approach?

  • Page copy seems to mess up item validation referenced fields in new page

    Hello team,
    this morning i create two pages as a copy of an existing page in Apex 4.0.1.
    This page contained 4 regions, each one containing 4 items, sort of:
    reg1
    P44_ITEM_A1
    P44_ITEM_B1
    P44_ITEM_C1
    P44_ITEM_D1
    reg2
    P44_ITEM_A2
    reg4
    P44_ITEM_D4
    There were field item validations defined on each pair of items P44_ITEMCn - P44_ITEMDn and each validation was associated with its corresponding field (the element attribute linking the validation with the error message visualization i mean).
    After creating the new page, i saw that some of these validations in the new page had lost their associated item attribute value or they were associated to the item with the highest item sequence, for instance P44_ITEM_A1 lost its associated item, while P44_ITEM_D1 was associated to P44_ITEM_D4.
    I just did this again a few seconds ago, so i am pretty sure this is a repeatable error.
    Flavio
    http://oraclequirks.blogspot.com
    http://www.yocoya.com

    Hi Flavio,
    I was able to reproduce this, of sorts. I created 2 regions each containing 4 page items, named in the way you describe. Then created item validations on all of those page items. Copied the page and the copied page contains some validations with a null 'Associated Item' value. Although, none were changed to a different item as you describe, in my test case.
    I have filed bug #10198224 for this issue.
    Thanks for reporting.
    Regards,
    Anthony

  • Validating page item  to be less than 50 charachters

    Hello,
    I have created validation for page item, its string and I want it to be not more than 50 letters,
    I used PL/SQL expression and I used this one
    V('P55_MANAGER_NAME').length > 50
    I got this error
    ORA-06550: line 1, column 47: PLS-00487: Invalid reference to variable 'NEW <expression>' ORA-06550: line 1, column 7: PL/SQL: Statement ignored
    Can some one help me in having the right expression??

    TomTom101 wrote:
    Hello,
    I have created validation for page item, its string and I want it to be not more than 50 letters,
    I used PL/SQL expression and I used this one
    V('P55_MANAGER_NAME').length > 50
    I got this error
    ORA-06550: line 1, column 47: PLS-00487: Invalid reference to variable 'NEW <expression>' ORA-06550: line 1, column 7: PL/SQL: Statement ignored
    Can some one help me in having the right expression??Well to start with the basic logic is incorrect.
    length > 50means "must be longer than 50 characters".
    Secondly
    V('P55_MANAGER_NAME').length > 50is a mixture of PL/SQL and JavaScript syntax. From the error message it appears you're doing this in an APEX Post-Submit Validation?
    In which case the syntax is
    length(:p55_manager_name) <= 50

  • Apex: Validation on two dependent page items

    Apex 4.2
    I have a  form with two separate regions that each have text fields / select list on them. I need to validate one field againt another.
    **Region 1
    - P10_REQUESTOR
    - Select List
    - LOV defenition:
    SELECT first_name
    FROM PERSONS
    ORDER BY firs_name
    I.e. you can select a first name from the select list
    **Region 2
    - P11_NAME
    - Text Field
    A regular text field to  type in the first name of a person
    **Logic:
    When a user navigates to this page, they can either pick a first name from the select list OR if the name is not in the list, they can type in the name in the P11_NAME text field. However, they can not do both. I am having a little trouble writing a validation script to capture these cases.
    Case 1: P10_REQUESTOR is null & P11_NAME is not null
    Case 2: P10_REQUESTOR is not null & P11_NAME is null
    If both items are null then an error message needs to appear stating that one or the other must be filled out
    If both items are not null then an error message needs to appear stating that you can only fill out one or the other
    I have pseudo coded it and understand the logic but am having trouble on knowing which options to choose when creating the validation. I was thinking its somewhere along the lines of a PL/SQL function with a few IF statments in it.
    Any help would be greatly appreciated. Thanks in advance.

    Hi NewApexCoder,
    your problem is solved in two ways,if i understand you correctly.
    You can do a simple javascript on the  NAME i.e you can enable and disable this item_type by putting this snippet into the  Form element attributes
    To take care of Case1
    OnBlur = "javascript: if (this.value != '') { document.getElementById('P11_NAME').value = 0; document.getElementById( ' P11_NAME').disabled = true; } else {document.getElementById ( 'P11_NAME').disabled = false;}"
    OR
    2.  In the  Select List Page Item ,By adding an extra  Display Extra Values = YES
                                       Display Null Value  = YES
    Null Display Value = '%'    Null Return Value = -1
    After which you can set up a validation for an item.
    Validations> Page>P10_REQUESTOR>  Then choosing a PLSQL Function Returning Boolean
    Validation Code
    begin
    if P10_REQUESTOR = -1 then
    return true;
    else
    return false;
    end;
    2.Error Message
    "A Request must be selected"
    To take care of case 2
    Thanks
    Benjamin.
    www.bkintsiful.blogspot.com

  • Problem with Item Validation

    Hello,
    I am running an advanced tutorial: http://download.oracle.com/docs/cd/E14373_01/appdev.32/e13363/issue_track_ui.htm#BGBJCGIC
    and I have a problem with item Validation.
    Tutorial offers the following:
    You must manually create another validation to ensure that the Actual End Date is the same or later then the Start Date.
    To add a validation for the Actual End Date:
    1.Under Page Processing, Validations, click the Create icon.
    2.For Level, accept the default, Item level validation, and click Next.
    3.For Item, select Project Details: 50.P3_ACTUAL_END_DATE (Actual End Date) and click Next.
    4.For Validation Method:
    a.Select PL/SQL and click Next.
    b.Accept the default, PL/SQL Expression and click Next.
    5.For Sequence and Name:
    a.Sequence - Enter 50.
    b.Validation Name - Enter P3_END_AFTER_START.
    c.Accept the remaining defaults and click Next.
    6.For Validation:
    a.Validation - Enter:
    to_date(:P3_ACTUAL_END_DATE,:APP_DATE_FORMAT) >= to_date
    (:P3_START_DATE,:APP_DATE_FORMAT)
    b.Error Message - Enter:
    Actual End Date must be same or after Start Date.
    c.Click Next.
    7.For Conditions:
    a.Condition Type - Select Value of Item in Expression 1 is NOT NULL
    b.Expression 1 - Enter P3_ACTUAL_END_DATE
    8.Click Create.
    Is there a mistake in explanation? I did it 3 times already, very carefully! I ran the page, entered the date, which is After the Start date, and get the error message: Actual End Date must be same or After Start Date!!
    Thank you for your consideration...

    I got it solved. I don't know if this is documented(or a bug) but what I did was declare an exception and then raise it and put the form_trigger_failure into the exception handler rather than raise form_trigger_failure in the body.
    declare
    alreadyExists exception;
    begin
    -- select .....
    raise alreadyExists;
    exception
    when alreadyExists then
    message('.....exists');
    raise form_trigger_failure
    end;

  • Page level validation to prevent duplicate data entry into the database

    Hello,
    Can anyone please help me out with this issue.
    I have a form with two items based on a table. I already have an item level validation to check for null. Now I would like to create a page level validation to check that duplicate data are not entered into the database. I would like to check the database when the user clicks on ‘Create’ button to ensure they are not inserting duplicate record. If data already exist, then show the error message and redirect them to another page. I am using apex 3.2
    Thanks

    Hi,
    Have you tried writing a PLSQL function to check this?
    I haven't tested this specifically, but something like this should work:
    1) Create a Page Level Validation
    2) Choose PLSQL for the method
    3) Choose Function Returning Boolean for the Type
    For the validation code, you could do something like this:
    DECLARE
        v_cnt number;
    BEGIN
        select count(*)
        into v_cnt
        from
        your_table
        where
        col1 = :P1_field1 AND
        col2 = :P2_field2;
        if v_cnt > 0 then return false;
        else return true;
        end if;
    END;If the query returns false, then your error message will be displayed.
    Not sure how you would go about redirecting after this page though. Maybe just allow the user to try again with another value (in case they made a mistake) or just press a 'cancel' button to finish trying to create a new record.
    Amanda.

  • Item Validation on a Form - Receives ORA-0094: Invalid Idenitier error

    I'm fairly new to APEX and having an issue with an Item Validation on a Form receiving the ORA-0094: <Column Name>: Invalid Identifier error. I have looked at postings in this form on this error and tried many of the suggestions. I still can not get it to work. My lack of experience with APEX is not helping either.
    I'm using APEX release 2.2 with IE6.
    I'm trying to create a new Invoice in the Invoice table (CTS_INVOICE). The RFA Number for this invoice must be an active RFA record in the RFA table (CTS_RFA). Before I add the check for the RFA active status, I wanted to get the code that checks for the existence of the RFA record working first.
    After filling in the fields on the forms, click the Create button, and receives an error page with the following error ORA-0094: "RFA_NUMBER": Invalid Identifier.
    I have checked to make sure the table name, column name, and item name were correct with spelling and capitalization.
    Used the Wizard to setup the Item Validation.
    Type: EXISTS
    Validation Expression 1: Select 1 from CTS_RFA where RFA_Number = :P25_RFA_NUMBER
    Error message: Enter an active RFA number.
    location: Inline with Field and in Notification
    Associated Item: P25_RFA_NUMBER
    Any help would be greatly appreciated.
    Thanks,
    Vivian

    Vivian - Might the column have been created as a quoted identifier with mixed upper/lower case characters?
    Run this in SQL*Plus:
    select count(rfa_number) from cts_rfa;
    If that works without error then this is not the problem.
    Scott

  • Conditionally set page item based on value of another item

    Hello,
    I have a form that is used to create/apply changes to records. There is an application item (APP_ITEM_PROFILE)
    that is set on login which contains a value for the user's Profile ID. This Profile ID is used through out the
    application for authorizations (conditionally present tabs, etc).
    I've set a page item on the form equal to APP_ITEM_PROFILE so that the record is stamped
    with that user's profile ID when they create a record. Users with different Profile IDs may later make changes to
    the record but I want to keep the original Profile_ID on the record.
    I am trying to populate the Profile ID conditionally in the form based on the existence of a
    record ID. If there is no ID (a new record is being entered), then I want the
    Profile ID to be that of the current user (APP_ITEM_PROFILE). If there is an ID (modification is
    being made to an existing record), then I want the keep the Profile ID that was originally saved
    with the record in MyTable.
    I have this as the source for :P11_PROFILE_ID. The type is PL/SQL Expression or Function, Always, replacing... but it
    is not working (page not found when page is run):
    begin
    if :P11_ID is not null
    then
    select PROFILE_ID
    into :P11_PROFILE_ID
    from MyTable
    where ID = :P11_ID;
    elsif :P11_ID is null
    then select nv(':APP_ITEM_PROFILE') into :P11_PROFILE_ID from dual;
    end if;
    end;
    Item Descriptions:
    ID is the record ID.
    :P11_ID is the page item of the record ID (Display as Text, saves state).
    PROFILE_ID is the user's Profile ID.
    :P11_PROFILE_ID     is the page item of the user's Profile ID.
    :APP_ITEM_PROFILE is the user's Profile ID that is set on login.
    Any help is greatly appreciated.
    Thanks,
    Matt
    Update:
    I found one of Scott's answers:
    Using IF Else to determine the value of a Item
    and modified the above code to:
    declare l_ret number;
    begin
    if :P11_ID is not null
    then
    select PROFILE_ID
    into l_ret
    from MyTable
    where ID = :P11_ID;
    else select :APP_ITEM_PROFILE' into l_ret from dual;
    end if;
    return l_ret;
    end;
    It seems to be setting the Profile ID correctly when the ID is not null, but not when a new record is being created. In the latter case, there is no value.
    Edited by: mterlesky on May 11, 2009 11:02 PM
    Edited by: mterlesky on May 11, 2009 11:52 PM
    Edited by: mterlesky on May 11, 2009 11:53 PM

    Thanks. That is putting the value into the page item and session state but that value is not being saved when the record is created. I'm not sure why - here is part of the debug (the "Billing" table is the "MyTable" table in the previous posting). Any thoughts?
    On form, before submit:
    0.06: Saving g_arg_names=P11_PROFILE_ID and g_arg_values=112
    0.06: ...Session State: Saved Item "P11_PROFILE_ID" New Value="112"
    After Submit
    0.06: ...Session State: Save "P11_PROFILE_ID" - saving same value: "112"
    (validations not shown)
    0.10: Processing point: AFTER_SUBMIT
    0.10: ...Process "Get PK": PLSQL (AFTER_SUBMIT) declare function get_pk return varchar2 is begin for c1 in (select BILLING_SEQ.nextval next_val from dual) loop return c1.next_val; end loop; end; begin :P11_ID := get_pk; end;
    0.10: ...Session State: Save Item "P11_ID" newValue="452" "escape_on_input="Y"
    0.10: ...Do not run process "Get PK for CREATEAGAIN", process point=AFTER_SUBMIT, condition type=, when button pressed=CREATEAGAIN
    0.10: ...Process "Process Row of BILLING": DML_PROCESS_ROW (AFTER_SUBMIT) #OWNER#:BILLING:P11_ID:ID|IUD
    0.10: ...Process "Update TOTAL_HOURS": PLSQL (AFTER_SUBMIT) begin Update billing set TOTAL_HOURS = ((NVL(CD_90801_UNITS,0)*1.5)+ (NVL(CD_90804_UNITS_B,0)*.5)+ NVL(CD_90806_UNITS,0)+ (NVL(CD_90808_UNITS_B,0)*1.5)+ NVL(CD_90812_UNITS,0)+ (NVL(CD_90814_UNITS_B,0)*1.5)+ NVL(CD_90846_UNITS,0)+ NVL(CD_90847_UNITS,0)+ NV
    0.11: ...Process "Update TOTAL_UNITS": PLSQL (AFTER_SUBMIT) begin Update billing set TOTAL_UNITS = (NVL(CD_90801_UNITS,0)+ NVL(CD_90804_UNITS_B,0)+ NVL(CD_90806_UNITS,0)+ NVL(CD_90808_UNITS_B,0)+ NVL(CD_90812_UNITS,0)+ NVL(CD_90814_UNITS_B,0)+ NVL(CD_90846_UNITS,0)+ NVL(CD_90847_UNITS,0)+ NVL(CD_90853_UNITS,0)+ NV
    0.11: ...Process "G_TRANS_COUNT_ADD": PLSQL (AFTER_SUBMIT) begin :G_TRANS_COUNT := :G_TRANS_COUNT +1; end;
    0.11: ...Session State: Saved Item "G_TRANS_COUNT" New Value="1"
    0.11: ...Process "Email_Notification": PLSQL (AFTER_SUBMIT) declare l_body_html varchar2(4000); begin l_body_html := '<p>Billing ID '||:P11_ID||' was entered by '||:P11_PROV_NAME||'.'|| ' More transactions may have been entered by the provider after this one.'||'</p> <p><a
    Edited by: mterlesky on May 12, 2009 9:21 AM

Maybe you are looking for

  • How can you toggle H264 on and off in a NetStream?

    Hello.  Let's say you have the following code that switches your stream to use H264: var h264Settings:H264VideoStreamSettings = new H264VideoStreamSettings(); h264Settings.setProfileLevel(H264Profile.BASELINE, H264Level.LEVEL_2); stream.videoStreamSe

  • Mp3 player default prog

    How do you change the default program for a creative zen micro so when i plug it into my PC a program i have choose pops up

  • Email folder view issue with netbook laptop

    Help!  Cannot see my email folders listed when I use my Samsung netbook.  Clicking on folders opens the folder list on the right side but there is nothing to click on on the left side.  The folder list is visible on the left side when I use a desktop

  • NVidia video card- Lightroom freezes at startup, stalls, crashes when switching modules [Windows]

    Issue: Adobe Photoshop Lightroom freezes when you start, crashes when you switch between modules, displays blank screens in Slideshows, stalls frequently or runs extremely slowly.  Solution: The nVIDIA nView Multi-Display Technology software (also kn

  • Os 9.1 install on g4 10.4.9 won't boot into classic

    I'm trying to install os9 onto the same partition as 10.4.9. I boot onto the os9 install disk, it installs just fine, will open in os9 just fine, but won't boot up in classic under 10.4. (sorry for the run on sentence) I can get to the OS9 screen and