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

Similar Messages

  • 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]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • 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.

  • How to implement a page level validation !!

    Hello ,
    I want to implement page level validation.
    thanks
    Edited by: kumar73 on Apr 21, 2010 1:41 PM

    Should be pretty easy - your condition would probably just be the click of the button (button name) or the request value sent by the button (SUBMIT?) You can do a function returning boolean as the type
    The code would be something like:
    begin
      if :P1_SHUTTLE is not null or
      :P1_SHUTTLE2 is not null or
      :P1_SHUTTLE3 is not null or
      :P1_SHUTTLE4 is not null or
      :P1_SHUTTLE5 is not null then
        return(true);
      else
        return(false);
      end if;
    end;

  • Recommended practice for handling page level validation?

    I'm wondering what the recommended practice is for handling what I would call "page level validation?"
    For example, I have two text boxes. Either one text box or the other must have a non-null value. If they are both null, I want the page validation to fail and redisplay the page the same way it would if validation for a particular field failed. However, I don't want the message that is posted to be associated with either of the two text boxes. I want it to use some other unique ID because I want to display the error text at a location that is different than for either of the text box error messages.

    The reason I don't want to use a custom converter is because I'm using a custom tag/renderer which aggregates several HTML input components and has complex conversion logic. Maybe I could chain things together, but, a converter should be used for conversion not validation. Secondly, I don't understand why validation occurs after conversion. This seems backward to me.
    One hack that I tried which almost worked was to create a custom tag/rendererer that was an input component, but, had no visible UI. I made that component always have a value which caused the validator to always be called. I made it so that it accepted a method binding as an input so that you could specify which validation method was called. I checked the component values for the components of interest using UIInput.getValue(). However, I ran into what might be a bug. Everything worked fine as long as the value changed to a non-null value. When the value was set to null, UIInput.getValue() was returning the old value instead of null. The strange thing is that the bean property that the component was bound to, ultimately was changed to null as I would have expected to. The problem was that UIInput.getValue() was returning the old value instead of null.
    My current solution which isn't ideal is by using code similar to the following in my action method that my form submit button calls.
    if(value1 == null && value2 == null) {
    String message = "Validation Error: Value is required.";
    FacesContext context = FacesContext.getCurrentInstance();
    context.addMessage("id1", new FacesMessage(message, message));
    return "validationError";
    Note, I had to create my own custom tag/renderer equivalent of h:message because I couldn't get h:message to work. h:message couldn't find the message that I posted.
    The down side to doing it this way is that the validation is occurring after the validation phase. Hence, the error message isn't displayed at the same time as other error messages. Furthermore, if you have more than one button on the form, you'd have to do the check for each action method.
    This is really stupid. I can't believe something that should be so simple is so difficult in JSF. I'm planning on taking a closer look at ASP.NET. I'm pretty sure all you have to do in ASP.NET is override a method to do this and you have access to all the form controls as variables within the Page object. i.e. no having to lookup the controls using a method and a client ID.

  • Page leve validation

    I have what I thought was a simple validation but it does not seem to be working. I have the following set as a page level validation, p/sql expression:
    :P2_ITEM_COLOR iis null AND :P2_ITEM_DESC is null
    Is seems to always be true however, even if I have selected both P2_ITEM_COLOR and P2_ITEM_DESC . These are both drop down lists. Thoughts?

    I think perhaps you are getting the concept of this particular validation back to front. The validation only throws an error if the result validation is false, therefore if your validation is returning true for both being null, then naturally its not going to fail.
    You need to make the expression return false i.e. (in pseudocode)
    NOT (:P2_ITEM_COLOR is null and :P2_ITEM_DESC is null)or alternatively:
    (:P2_ITEM_COLOR is not null) OR (:P2_ITEM_DESC is not null)Edited by: JoelC on 11-May-2010 15:51

  • Adding item level validation to a field

    Hi All,
    I am new to Oracle APEX.
    I have a field named semester_code in my page and I want end user to enter only alphanumeric values. I want to create item level validation using regular expressions, but I don't know what expression to write for this purpose.
    Any help will be highly appreciated.
    Thanks
    Bilal

    Hi,
    Go to the validations section of the application builder (for the application you are working on)
    -> add item level validation
    -> select the field that you are trying to validate
    ->item string comparison
    -> select 'Item specified is alphanumeric' from list
    Chris

  • Item Level Validations on Submit

    Hello guys,
    I would like to use Item level Validations but I have a problem. When I submit the page from a button the Item Level Validations automatically fire, can I not run the item validaitons when a specific button is pressed and not 'on submit'? If so how...
    Thanks in advance
    Spam

    Hi "user502286",
    in APEX 4.0 you have more control if validations (also the built-in one for required) should automatically fire during submit or not than in previous APEX versions. It's all about the two new settings
    -) "Execute Validations" which is available in the "Action When Button Clicked" section of a button and
    -) "Always Execute" for validations
    Please consult the field level help for this attribute to find out how they should be set.
    Hope that helps
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Aplication Vs. Page level items for application process

    Hi,
    I have many application processes in my applications, many of them take parameters.
    Right now I am passing parameters using page level temporary items. This is causing each page to have many items that are only used for calling the application process.
    Is it better to use application level items for this purpose?
    any pros and cons for each of these?
    ~Ketan

    Arie,
    Are you saying that the condition only apply to rendering the item, but the APEX engine will still consider such an item a valid “internal” variable?
    Yes. The absence of a condition on a page item or a condition that evaluates to true simply allows it to be rendered on the page. The existence of the item in the page definition allows it to hold session state.
    We're planning to introduce a non-displaying page item type just for this purpose, sort of a scratchpad variable with no display properties, like an applicaition item but defined on a page.
    Scott

  • Quotes in a page level item not showing up as " when used in a hyper link

    Hi all,
    In my app, I need to hyper link to a crystal report application with parameters from my page. I have a page level item that puts my parameter in quotes, but when the item is utilized in the hyperlink, the quotes come across as & q u o t ; (spaces were put in to the post to avoid html conversion) how can my string be used to appear the way I want?

    I don't use Crystal Reports, but, in general, you should encode your URL. When you create your link, run the URL through utl_url.escape() first. Put it in your select statement.
    E.G.,
    select utl_url.escape('http://oracle.com/foo"bar') from dual;
    will escape/encode the quotation mark and give you:
    http://oracle.com/foo%22bar
    This translates the " into a URL-safe escape code, %22, that should (I hope) be understood properly by your Crystal Reports server.
    Good luck.

  • Drill Down in Pivot Table with item on page level

    Hi,
    I've got a pivot table with Chart next to it. The chart is a separate view, I did not use the 'Chart pivoted results' option.
    My pivot table has one Page Level item being the Month Name.
    I now have the strange behavior that drilling down on the Pivot table elements gives me No Results as my filter would be too restrictive. The problem is with the 'Month Name'. Removing this item from the filter shows the correct data. When I use the chart next to my data to do the drilling I encounter no problems. This is because this way the restriction on the month name is not added when drilling.
    Has anybody encountered this behavior before and knows of a way to solve this.
    Thanks for your advice,
    Kris

    My query looks like this :
    SELECT TO_NUMBER (TO_CHAR (t1601.datum_prestatie, 'MM'), '99') AS c3,
    t1584.description AS c4, t1497.project_group AS c5,
    t1497.project_desc AS c6, t1497.project_code AS c7,
    CONCAT (CONCAT (t2241.firstname, ' '), t2241.lastname) AS c8,
    t2254.employee_number AS c9, t1601.duur AS c11,
    t1601.datum_prestatie AS c12
    FROM t_projects t1497 /* Dim_PROJECTS */,
    t_organization t1579 /* DimX_ORGANIZATION_Project */,
    t_organization t1584 /* DimX_ORGANIZATION_Project_Parent */,
    t_employees t2241 /* DimA_EMPLOYEE_Prestatie */,
    t_prestaties t2254 /* DimA_PRESTATIE_Project */,
    t_prestaties t1601 /* Fact_PRESTATIES */
    WHERE ( t1497.business_domain_code = t1579.department_code
    AND t1497.project_code = t1601.project_code
    AND t1497.project_code = t2254.project_code
    AND t1579.parent_department = t1584.department_code
    AND t2241.employee_number = t2254.employee_number
    AND t1584.description = 'Specialized Technologies'
    AND t1497.project_group = 'SUPP AP TM'
    AND TO_NUMBER (TO_CHAR (t1601.datum_prestatie, 'MM'), '99') = 3
    The last row being a check on the month number.
    At the same time in OBIEE I get this :
    No Results
         The specified criteria didn't result in any data. This is often caused by applying filters that are too restrictive or that contain incorrect values. Please check your Request Filters and try again. The filters currently being applied are shown below.
         Divisie is equal to Specialized Technologies
    and      Month is equal to 3
    and      Project Group is equal to SUPP AP TM
    and      Month Name is equal to Mar
    The physical query doesn't even show the restriction on Month Name which makes it even more spooky...

  • Why item level validation can only execute function but not procedure?

    Dear all,
    When execute my form, some parameter values will be passed to the text items.
    Those values are the procedure name or function name for that particular item which are already defined in a package and those items are non-database items.
    Suppose a particular item can be validated by a procedure or function. It depends on what value is passed into the program.
    If the item when-item-validation is triggered, that corresponding procedure or function will be executed by calling the following codes A) or B):
    A) EXECUTE IMMEDIATE 'BEGIN' || procedure || '(:1);END;' USING v_value;
    OR B) DBMS_SQL.EXECUTE(...)
    Basically, the form is working fine except 2 blocks which can only accept Function, i.e. only fired the function but cannot fire the procedure. Actually these 2 blocks are similar to the others blocks and they are also non-database blocks.
    I am using Form10g.
    Anyone have idea for that? Thanks for advance.
    Regards.

    You cannot use Execute Immediate in Forms. You have to do that on the server in a stored procedure.
    You should not use DBMS_SQL either. In Forms, you use EXEC_SQL, which is almost the same, except for the error handling. And it is VERY slow, since you make a number of calls to it, plus one for each variable passed.
    Now... if you call a function, it must return a value. If you write code to dynamically call a function, this process must be complex enough to handle the returned value. The same occurs if your procedure that you call has any parameters. If there are no parameters, then it would be simpler.
    If you want dynamic function or procedure processing, then I would suggest you just pass the value being validated plus the table.column name to a server-side stored procedure or package, and do all the processing on the server.
    Good luck... it won't be easy.

  • Field level validation

    I was looking at the Add/Modify Customer page – page 7 in the Sample Application which can be loaded into Oracle XE and was surprised to discover that there doesn’t seem to be any field validation. For example customer first name is set to varchar2(20) at database level yet more than 20 characters can be entered into the application field and there is no error message when moving cursor focus to another field. Credit Limit field is numeric only but alpha characters can be entered and again, there is no error message when moving cursor focus to another field. Error messages are only displayed on hitting the Create button and even then they are standard ORA-99999 type messages – not very friendly to your average end-user I would suggest! I would be amazed if field-level validation (javascript maybe?) can’t be included in XE applications – assuming it can be, can anyone tell me how it works, even point me towards a working example – if I’m really lucky(!) Phil

    As part of the page editor, looks in the center for validations. Right there you can enable all kinds of validations required for the objects in your page.
    If you require you can use JavaScript to activate those validations also. Check the
    Page Definition = Validation
    You can use Item Validation or Page Validation.
    A look to the APEX user manual will help with more examples on this.
    Regards Dino.

  • How to find out in which items, pages a function/procedure,.. will be used?

    I'm searching for the answer for:
    Are there any script tools which find all place in apex , where functions/ packages/ procedures be used ?
    -> want find where p_my_function is using. (Item level, page level, ....)
    Thank in advanced
    Hendrik
    Edited by: Hendrik Schmidt on Dec 13, 2010 12:46 AM

    Based on the APEX views (*Home > Utilities > Application Express Views*) I've been using this, run in the parsing schema for the application. It's set up to look at one application at a time as this is the best fit for our requirements:
    with search as (
          select :search_term search_term from dual)
      , app_source as (
          select
                    'Application Computation' component
                  , null                      page_id
                  , null                      sequence
                  , aac.computation_item      name
                  , null                      point
                  , aac.computation_type      type
                  , to_clob(aac.computation)  source
                  , s.search_term
          from
                    apex_application_computations aac
                  , search                        s
          where
                    nvl(aac.condition_type, 'None') != 'Never'
          and       (   aac.computation_type like 'SQL%'
                     or aac.computation_type like 'PL/SQL%')
          and       regexp_like(aac.computation, s.search_term, 'ni')
          union all
          select
                    'Application Process'
                  , null                
                  , aap.process_sequence
                  , aap.process_name    
                  , aap.process_point   
                  , aap.process_type    
                  , aap.process         
                  , s.search_term
          from
                    apex_application_processes  aap
                  , search                      s
          where
                    aap.application_id = :app_id
          and       nvl(aap.condition_type, 'None') != 'Never'
          and       regexp_like(aap.process, s.search_term, 'ni')
          union all
          select
                    'Application Tree'
                  , null
                  , null
                  , aat.tree_name
                  , null
                  , null
                  , to_clob(aat.tree_query)
                  , s.search_term
          from
                    apex_application_trees  aat
                  , search                  s
          where
                    aat.application_id = :app_id
          and       regexp_like(aat.tree_query, s.search_term, 'ni')
          union all
          select
                    'LOV'
                  , null
                  , null
                  , aal.list_of_values_name
                  , null
                  , null
                  , to_clob(aal.list_of_values_query)
                  , s.search_term
          from
                    apex_application_lovs aal
                  , search                s
          where
                    aal.application_id = :app_id
          and       aal.lov_type = 'Dynamic'               
          and       regexp_like(aal.list_of_values_query, s.search_term, 'ni')
          union all
          select
                    'Page Process'
                  , aapp.page_id
                  , aapp.execution_sequence
                  , aapp.process_name     
                  , aapp.process_point    
                  , aapp.process_type     
                  , aapp.process_source   
                  , s.search_term
          from
                    apex_application_page_proc  aapp
                  , search                      s
          where
                    aapp.application_id = :app_id
          and       nvl(aapp.condition_type, 'None') != 'Never'
          and       regexp_like(aapp.process_source, s.search_term, 'ni')
          union all
          select
                    'Page Region'
                  , aapr.page_id
                  , aapr.display_sequence
                  , aapr.region_name     
                  , aapr.display_position
                  , aapr.source_type     
                  , aapr.region_source   
                  , s.search_term
          from
                    apex_application_page_regions aapr
                  , search                        s
          where
                    aapr.application_id = :app_id
          and       aapr.source_type in ('Report', 'PL/SQL', 'Tabular Form', 'Tree')
          and       nvl(aapr.condition_type, 'None') != 'Never'
          and       regexp_like(aapr.region_source, s.search_term, 'ni')
          union all
          select
                    'Page Item'
                  , aapi.page_id
                  , aapi.display_sequence
                  , aapi.item_name
                  , aapi.region
                  , aapi.item_source_type
                  , to_clob(aapi.item_source)
                  , s.search_term
          from
                    apex_application_page_items   aapi
                  , apex_application_page_regions aapr
                  , search                        s
          where
                    aapi.region_id = aapr.region_id
          and       aapr.application_id = :app_id
          and       nvl(aapi.condition_type, 'None') != 'Never'
          and       nvl(aapr.condition_type, 'None') != 'Never'
          and       (   aapi.item_source_type like 'SQL%'
                     or aapi.item_source_type like 'PL/SQL%')
          and       regexp_like(aapi.item_source, s.search_term, 'ni')
          union all
          select
                    'Page Computation'
                  , aapc.page_id
                  , aapc.execution_sequence
                  , aapc.item_name
                  , null
                  , aapc.computation_type
                  , to_clob(aapc.computation)
                  , s.search_term
          from
                    apex_application_page_comp  aapc
                  , search                      s
          where
                    aapc.application_id = :app_id
          and       nvl(aapc.condition_type, 'None') != 'Never'
          and       (   aapc.computation_type like 'SQL%'
                     or aapc.computation_type like 'PL/SQL%')
          and       regexp_like(aapc.computation, s.search_term, 'ni')
          union all
          select
                    'Page Validation'
                  , aapv.page_id
                  , aapv.validation_sequence
                  , aapv.validation_name
                  , null
                  , aapv.validation_type
                  , to_clob(aapv.validation_expression1 || '/' || aapv.validation_expression2)
                  , s.search_term
          from
                    apex_application_page_val  aapv
                  , search                     s
          where
                    aapv.application_id = :app_id
          and       nvl(aapv.condition_type, 'None') != 'Never'
          and       (   aapv.validation_type like 'SQL%'
                     or aapv.validation_type like 'PL/SQL%')
          and       regexp_like(aapv.validation_expression1 || aapv.validation_expression2, s.search_term, 'ni'))
    select
              page_id
            , component
            , sequence
            , name
            , point
            , type
            , search_term
            , count(*) over (partition by search_term) func_use_count
    from
              app_source
    where
              search_term is not null
    order by
              page_id nulls first
            , component desc
            , sequence
            , name
            , point
            , type;Edited by: fac586 on 13-Dec-2010 09:14
    Note that this is on an APEX 3.0 installation. There may be more potential locations to be checked in later versions.

  • Page level help text question

    APEX - 4
    DB version - 10g
    Web server architecture - OHS
    Browser - IE8
    Theme - 5
    I know how to set and display help text for a page item, and I see there is the option to add help text at the page level, but how does the user accessing the screen see the page level help text?
    I was thinking it might be a good way to add user help guide information at the page level.
    Thank you for any assistance.

    I know how to set and display help text for a page item, and I see there is the option to add help text at the page level, but how does the user accessing the screen see the page level help text?Using a Help page and region accessed via a help link (e.g. a navigation bar entry), or using the <tt>apex_application.help</tt> API method in a PL/SQL Dynamic Content region.
    This is covered in the APEX documentation which should be consulted before posting a question here.

Maybe you are looking for

  • Just installed the update and now iTunes wont open! Help!!!

    Just installed the update and now iTunes wont open! Help!!!

  • How to use LOV on a derived table dependent on a prompt for Webi web intelligence view.

    The semantic layer has not created a defined LOV for the derived table.   This only happens when pulling columns from derived table which depends on a prompt for unique selection.  When pulling from derived table that does not depend on a date prompt

  • RMAN Scripts for 9i RAC

    We have just recently started to use Oracle 9i RAC on Red Hat linux 2.1. And we are going to use RMAN for backing up the archived logs. Currently we have 2 node cluster and the archived logs of respective nodes are on their respective local hard disk

  • Handling serial data

    I'm not sure how to handle the serial data I'm receiving from a touchscreen panel. All I want to do is display the two sets of coordinates, which are made up of two 4 digit numbers. What I'm struggling with, is the carriage return/line feeds (Cr/Lf).

  • How to uninstall apache server?

    Recently I can not visit google.nl and google.com. Somehow I get redirected to a screen of Apache server ssl. I am not aware I installed any software recently that cause the issue. Anyone any idea how to fix this?