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;

Similar Messages

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

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

  • 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

  • How to implement Bursting(Row level security) in Xcelsius

    Hi,
    We are using Xcelsius 2008. We have created xcelsius dashboard using Qaaws but for authentication in qaaws we are suing enterprise authentication and default user.
    Now in my dashboard i have one combo box wich gives data fro diffrent states, now i need to restrict the user to see the state values. I implement the row level security in universe, when i create webi report and view that reprot in infoview, the row level security works. But when i publish the dashboard to infoview the row level security doesn't work.
    We are uisng XO 3.1 with SSO on IIS. So how and what are the diffrent option available to implement the row level security in Xcelsius Dashboard.
    Thanks for the help in advance.
    Thanks,
    Nimesh.

    Nimesh,
    Were you able to implement ? I have a requirement to use the same dashboard for 5 regional users.
    Row level security works.
    combo box intial value is Global , when I login as North America user, combo still shows Global but it will have the value of North America.
    i am curious to know how you implemeted this?
    Thanks
    Pushpa

  • How to implement Review Page functionality

    Hi,
    I developed one custom Page, In that page user will enter data and click on Submit.
    Requirement is before submitting, user needs review the data and click on submit.
    Please suggest how to implement this functionality.
    Thanks in Advance,
    Hanimi.

    So far I have noticed that the best idea will be to recreate and code by
    myself. As You probably know each SSHR function ends with review page that shows the changes I just want the same.
    So problem that I have is, I need to implement Dynamic Approvals so the
    employee should be able to see who is going to approve and add approvers if
    neccessary. And I cannot find any information on how to code that.
    I jsut want the same functionality as in standard modules.

  • How to implement "First Page" command in WAD

    Hi there
    I have a bug in my code, in that if the user pages down a few times, then chooses to Display All Rows (option provided in dropdown), the code works correctly to display all rows, but starts at the point at which the user was ... not from row 1 as should be the case.
    In case this doesn't make sense :
    - Assume that the table shows 10 rows at a time
    - On first entry, rows 1-10 will be displayed
    - User presses the standard page-down button ... rows 11-20 now displayed
    - User now presses button to show all rows (say there are 30 rows in the query)
    - User now sees rows 11-30, with no paging functionality.
    I would like to add / insert an additional command which navigates to the first page, then shows all the rows, but I can't figure out how.
    I have tried setting DATA_ROW_FROM to 1, but that doesn't help.
    Please note that I can set the parameters to show all the rows, just need to be able to navigate to row 1 before I do that.
    Any ideas?
    Cheers,
    Andrew

    Come on ... nobody out there with an idea?

  • How to implement a page showing different database tables

    I am wondering what is the best way to implement the following task:
    On the left side of a page, there are two Listboxes. On the right side of the page, I want to display different database tables depending on the selected value from those two Listboxes.

    I am wondering what is the best way to implement the
    following task:
    On the left side of a page, there are two Listboxes.
    On the right side of the page, I want to display
    different database tables depending on the selected
    value from those two Listboxes.A Data Table component isn't really designed to dynamically swap which database table you're binding too (and therefore which set of columns you will display) under the covers. Here are a couple of general strategies to consider for accomplishing your functional requirements:
    * Create a separate Data Table component for each possible database table, all on the same page, and dynamically set the "rendered" property of the selected Data Table to true, while setting it to false for all other Data Tables. That way, only the corect one will be shown.
    * Create a separate page for each Data Table, using a similar look and feel so that it appears to the user like it's all the same page. To save cutting and pasting the list components, put them in a JSP Page Fragment so they can be reused on each page. ((SIDE NOTE: This is a very common technique for simulating what looks like tabbed panes, but where the implementation actually uses separate pages.))
    * Use frames so that the left frame (containing the list boxes) stays the same, and the right frame switches to a different page for each of the tables. This is essentially another way to share the list components across the pages.
    * Abandon all the ease-of-use stuff Creator provides for binding to data tables, and write code that programmatically erases all the old child components and creates new ones. This is the sort of thing you'd need to do for a "SQL BROWSER" sort of application, where the set of columns is not known ahead of time.
    Craig McClanahan

  • ToyStore Unexpected exception / Entity Level validation check question.

    Hi,
    JDev 10..1.2
    I'm using the ToyStore Exception/Error handler.
    I added an Entity level validation test by adding following test in the validateEntity method of my entity:
    protected void validateEntity()
    super.validateEntity();
    if (this.getAccountStatus() != null && this.getAccountStatus().compareTo(Constants.NUMBER_20) < 0)
    throw new JboException(ErrorMessages.class,"14000",null);
    In the ErrorMessages class I added following line to the message array:
    { "14000", "Entity validation ERROR" }
    I would have expected to see this error in the "global error section" but the exception was handled as a "unexpected exception" and was shown in the stack trace but not in the generated page.
    Could you please tell me how to write an entity level validation error in the validateEntity method so that it gets displayed in the global error section?
    I succesfully added attribute level validation and it gets displayed at the attribute level.
    Here's the stack trace, notice that the message is retrieved from my ErrorMessages.class:
    05/08/10 11:28:03 com.photoswing.webview.actions.AccountCreateAction.reportErrors userLocale: English (United States)
    oracle.jbo.JboException: Entity validation ERROR
         at com.photoswing.model.site.AccountTestImpl.validateEntity(AccountTestImpl.java:83)
         at oracle.jbo.server.EntityImpl.validate(EntityImpl.java:1506)
         at oracle.jbo.server.DBTransactionImpl.validate(DBTransactionImpl.java:3944)
         at oracle.adf.model.bc4j.DCJboDataControl.validate(DCJboDataControl.java:958)
         at oracle.adf.model.binding.DCBindingContainer.validateInputValues(DCBindingContainer.java:1681)
         at oracle.adf.controller.lifecycle.PageLifecycle.validateModelUpdates(PageLifecycle.java:465)
         at oracle.adf.controller.struts.actions.DataAction.validateModelUpdates(DataAction.java:328)
         at oracle.adf.controller.struts.actions.DataAction.validateModelUpdates(DataAction.java:519)
         at oracle.adf.controller.lifecycle.PageLifecycle.handleLifecycle(PageLifecycle.java:115)
         at oracle.adf.controller.struts.actions.DataAction.handleLifecycle(DataAction.java:223)
         at com.photoswing.webview.actions.BaseDataForwardAction.handleLifecycle(BaseDataForwardAction.java:209)
         at oracle.adf.controller.struts.actions.DataAction.execute(DataAction.java:155)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1485)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:527)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:768)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
         at com.photoswing.filter.LocaleFilter.doFilter(LocaleFilter.java:191)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:235)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:600)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    Thanks
    Fred

    More info:
    If I write:
    <html-el:errors/>
    I get all the errors displayed.
    My purpose is to display the attribute level errors next is to each attribute and the Entity level errors at the top.
    So at the top I wrote:
    <html:errors property="<%= ActionErrors.GLOBAL_ERROR %>"/>
    I added following trace:
    At the beginning of the processException method:
    System.out.println(getClass().getName()+".processException, ex: "+ex.toString()+", ex.getClass().getName(): "+ex.getClass().getName());
    In the if block:
    if (attrName == null) {
    String errorCode = jboex.getErrorCode();
    globalErrs.add(jboex.getLocalizedMessage(locale));
    System.out.println("attrName == null, errorCode: "+errorCode+", jboex.getLocalizedMessage(locale): "+jboex.getLocalizedMessage(locale));
    My trace:
    05/08/10 12:19:44 com.photoswing.webview.actions.AccountCreateAction.processException, ex: oracle.jbo.RowValException: Failed to validate a row with key null of type WebAccountAM.AccountTestView1, ex.getClass().getName(): oracle.jbo.RowValException
    05/08/10 12:19:44 com.photoswing.webview.actions.AccountCreateAction.processException, ex: oracle.jbo.JboException: Entity validation ERROR, ex.getClass().getName(): oracle.jbo.JboException
    05/08/10 12:19:44 attrName == null, errorCode: 14000, jboex.getLocalizedMessage(locale): Entity validation ERROR
    Remark:
    AccountId => pk, not mandatory,refresh after insert => sequence fetched in pre-insert trigger
    Thanks
    Fred

  • 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

  • Page Level Security

    Hi,
    My company generate report using  "Actuate" reporting tool. Now they want to migrate from Actuate to Business object. Actuate can do Page level security" . How can I provide Page level security in BO ( In Designer or in Webi). Thank for your help.

    HI Vamsee ,
    Reports we can designed in such a manner like main report and sub report.
    so that subreport can be viewed in hyperlink...
    so that hyperlink can be restricted to some user and allowed to some user.
    (consider main report and subreport as page)
    Regards,
    Kannan.B

  • How to define a application level (or page 0) plsql validation

    I have a selection region on page 0, which I use on a lot of pages. I want to define plsql validation for the items in that region.
    I have already a database package with the validation code.
    Now I want to define each validation only once and not on each page.
    How can I do this.

    Funny thing happened to me on the way to creating my scenario on the apex.oracle.com site. I actually got it to work there. Once I attempted to simplify my scenario to reproduce it on apex.oracle.com, I figured out a simple step (hack?) that I was missing. I put that back into my site and it's working there now as well.
    If it's useful for others who attempt to do something like this, I needed to create a page-level process which doesn't really do anything except have a "NOT NULL" condition of the APP_ERROR_MSG application-level item and then use the "&APP_ERROR_MSG." syntax in the "Success Message" of that process. In essence, I'm telling the process to display the error as a success message when the APP_ERROR_MSG item is not null.
    I feel this is a hack because I would prefer to have this error message processing at the application level rather than at the page level. I was forced to put this process at the page level rather than at the application level because (as of ApEx 2.2) application-level processes do not have a "Success Message" option, only an "Error Message" option, while page-level process have both.
    Maybe my "fix" is truly a hack and I would love to hear that in order to get a better solution, that is more generic and application-level based. My sample app is at http://apex.oracle.com/pls/otn/f?p=32483:1 with the username of "devguest" and the same as the password.
    I look forward to hearing some thoughts.

  • How to implement Dynamic form validation

    Hello,
    I've been reading up on the forums about using the htmldb.item package to dynamically create form elements using a SQL query. Assuming I can generate the form dynamically, what approaches/options are available for implementing dynamic validation of the form elements themselves?
    Thanks in advance

    You could write a page-level 'PL/SQL Function Body returning error text' validation where you loop over your dynamic form elements (htmldb_application.g_fnn), check the values and raise errors as needed.

  • How to implement row level security using external tables

    Hi All Gurus/ Masters,
    I want to implement row level security using external tables, as I'm not sure how to implement that. and I'm aware of using it by RPD level authentication.
    I can use a filter condition in my user level so that he can access his data only.
    But when i have 4 tables in external tables
    users
    groups
    usergroups
    webgrups
    Then in which table I need to give the filter conditions..
    Pl let me know this ...

    You pull the Group into a repository variable using a session variable init block, then reference that variable in the data filters either in the LTS directly or in the security management as Filters. You reference it with the syntax VALUEOF("NQ_SESSION.Variable Name")
    Hope this helps

Maybe you are looking for

  • Line items are missing during transferring ITS to EBP--tricky problem

    Hi, We are using EBP 2.0 version. Some shopping carts line items are missing while transferring shopping cart data from ITS to EBP. This is happening randomly.we had checked all the shoppping cart related tables in EBP. For example in my shooping car

  • Problem with final issue of production order components

    Hi Gurus, Currently we have a problem with the production order components. The problem is that, we needed some components (components which are categorized as dangerous goods) deleted from the production orders. So we tried to manually tick the fina

  • Refresh available hierarchies from oltp / mark as relevant for BW in abap

    Hi All,   I can't solve this problem: I am loading hierarchies from R/3 to BW via infopackage. I created the solution to use one infopackage to load more than 300 hierarchies. But before I can do that I have to open an Infopackege, press the button "

  • Credential Not working

    hi ,   My SharePoint portal application is asking for credential again and again .I am entering portal account and farm account but none of them are accepting .I am calling the application from share point server only .I have disabled loop back check

  • Employee number in Master header

    Hi all, My client wants to display the portal users' employee number next to his or her name in the portal masthead. A picture named 'employeenumber'.jpg is available on a local file system of the portal server. This also needs to be displayed in the