Custom Error Message for Validation.....

Here is my Validation:
I want the error which is grown from what is wrong on the page to display after the validation.
the GUI for validation will not let me leave the Validation ERROR box empty...just not sure how to get around this.
DECLARE
isValid BOOLEAN := TRUE;
message VARCHAR2(4000):='';
BEGIN
if (:P14_EXISTING_METRIC_NAME IS NULL and :P14_METRIC_NAME IS NULL)
then
message := 'Metric Name is Not Chosen:';
isValid := FALSE;
end if;
if   (:P14_EXISTING_SUB_VALUE IS NULL and :P14_METRIC_SUBNAME IS NULL)
then
message := message || ' Sub Metric Name is Not Chosen:';
isValid := FALSE;
end if;
if NOT REGEXP_LIKE(:P14_METRIC_VALUE,'expression')
  then
message := message || ' Value is not Numeric:';
  isValid := FALSE;
end if;
if NOT isValid
then
   raise_application_error (-20001,message);
end if;
END;Edited by: bostonmacosx on Feb 27, 2013 12:05 PM

SO what I did was make sure that the process doesn't go false:
and at the end just checked my messages and added an error on the end. WHEW hope this helps someone in the future.
DECLARE
isValid BOOLEAN := TRUE;
message VARCHAR2(4000):=NULL;
BEGIN
if (:P14_EXISTING_METRIC_NAME IS NULL and :P14_METRIC_NAME IS NULL)
then
message := 'Metric Name is Not Chosen<BR>';
end if;
if   (:P14_EXISTING_SUB_VALUE IS NULL and :P14_METRIC_SUBNAME IS NULL)
then
message := message || ' Sub Metric Name is Not Chosen<BR>';
end if;
if (NOT REGEXP_LIKE(:P14_METRIC_VALUE,'^(\d{1,99})\.(\d{0,99})$') or :P14_METRIC_VALUE IS NULL)
  then
message := message || ' Value is not Numeric<BR>';
end if;
if message IS NOT NULL
then
apex_error.add_error (
        p_message          => message,
        p_display_location => apex_error.c_inline_in_notification );
end if;
END;Edited by: bostonmacosx on Feb 27, 2013 12:52 PM

Similar Messages

  • Customized error message for MethodValidator

    Hi,
    I coded a validation method and attached it to an entity attribute through the MethodValidator of the Entity Object validation tab.
    When I test it in the application module tester, it works fine. Just the error message produce by BC4J is too generic, like "JBO-27013: Attribute set validation method validateIsSoldTo failed for attribute IsSoldTo in Customer".
    Is there anyway that I can provide a more meaningful customized error message?
    I am using JDev 3.2.2 for a JSP application using Data Tag.
    Thanks!
    Dawson

    short of coding the dml procs yourself and trapping those error messages that way, i don't think we offer you a good way currently to trap and translate error messages coming out of our automatic DML processes. i've just logged the enhancement request to facilitate this, but for now i'm pretty sure you'd have to code that dml and trap your errs yourself.
    regards,
    raj

  • Custom Error Messages for Database Constraint Violations Problem

    Hi
    I have added a custom message bundle for the model project as explained in
    37.8.3 in the Fusion Developer's Guide - How to customize error messages for database constraint violations.
    http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/bcadvgen.htm#BABEFGCI
    Constraint Name : SYS_C0018574
    And I have following CustomErrorMessages class
    public class DBCustomErrorMessages extends ListResourceBundle {
        private static final Object[][] sMessageStrings =
            new String[][] { { "SYS_C0018574",
                               "Existing Record Found" } };
        protected Object[][] getContents() {
            return sMessageStrings;
    }This works fine when I run application model and adding records to vialate the constraint. So it gives me following message
    (oracle.jbo.DMLConstraintException) Existing Record FoundBut when run ui project it does not fire.
    Still it gives the message
    ORA-00001: unique constraint (CCBS2.SYS_C0018574) violatedCould you please shed some light?
    Edited by: deshan on Mar 15, 2011 11:28 AM

    Please see the image.
    http://4.bp.blogspot.com/-Fna66p-W5Jw/TX7uSQqqBtI/AAAAAAAAAH0/D1APg6oAIxI/s1600/1.JPG
    Error in Application Module ORA-00001: unique constraint (CCBS2.SYS_C0018574) violated exception is different from ui project.
    Any hint?
    Thanks
    deshan
    Edited by: deshan on Mar 15, 2011 10:16 AM

  • Custom error message for Back Button Error

    I am using JDeveloper 9. I have tried to create a custom error message to handle a "Back button" press.
    But the error message is usually ignored and the system's regular "Stale data" message appears. Is there a way to prevent the system's message from appearing and to raise a custom error message?

    Do the following coding in your processRequest() of the Create or udpate page.
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    // If isBackNavigationFired = false, we're here after a valid navigation
    // (the user selected the Create button) and we should proceed
    // normally and initialize a new employee.
    if (!pageContext.isBackNavigationFired(false))
    // We indicate that we are starting the create transaction (this
    // is used to ensure correct Back button behavior). Note that you
    // can assign whatever name you want to your transaction unit.
    TransactionUnitHelper.startTransactionUnit(pageContext, "empCreateTxn");
    // This test ensures that we don't try to create a new employee if
    // we had a JVM failover, or if a recycled application module
    // is activated after passivation. If these things happen, BC4J will
    // be able to find the row that you created so the user can resume
    // work.
    if (!pageContext.isFormSubmission())
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    // Call your method to handle creating the new row.
    am.invokeMethod("createEmployee", null);
    else
    if (!TransactionUnitHelper.isTransactionUnitInProgress(pageContext, "empCreateTxn", true))
    // Get the purchase order number from the request.
    String orderNumber = pageContext.getParameter("headerId");
    MessageToken[] tokens = { new MessageToken("PO_NUMBER", orderNumber)};
    OAException message = new OAException("ICX", "FWK_TBX_T_PO_UPDATE_CONFIRM", tokens,
    OAException.CONFIRMATION, null);
    // We got here through some use of the browser "Back" button, so we
    // want to display a state loss error and disallow access to the page.
    // If this were a real application, we would probably display a more
    // context-specific message telling the user they can't use the browser
    // "Back" button on the "Create" page. Instead, we wanted to illustrate
    // how to display the Applications standard NAVIGATION_ERROR message.
    OADialogPage dialogPage = new OADialogPage(message);
    pageContext.redirectToDialogPage(dialogPage);
    } // end processRequest()
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Reg:- Custom Error Message for 404 error in KM Document iView

    Hi All,
    We have a requirement to display a custom error page instead of the standard"404 - The requested resource is not available" displayed in KM document iView, when the resource in question doesn't exist.
    Is it possible to display custom error message? If so, how can we achieve this functionality? What are the settings to be made?
    Appreicate your help.
    Thanks and Regards,
    Pavithra

    Hi Ravi,
    Thank you for the reply.
    But the scenario what I am talking about is different from the one mentioned in the link.
    I am using a KM Document iView. In the iView parameter, Path to Document, I have given the path to a document which does not exist in KM.
    For example, Path to Document - /documents/Test Folder/abc.html.
    There is no document by the name abc.html in KM.
    In this case, I get an error called "404 - The requested resource is not available." How can I get rid of this message and show a custom message instead?
    Please note that, this message appears at the iView level (and not page level as mentioned in the link)
    Appreciate your help.
    Regards,
    Pavithra

  • Custom Error Message For Session State Violation

    Hi,
    Can anyone tell me is there a way to have a custom error message whenever there is a session state protection violation ?
    Currently it throws an error message as follows:
    "Session state protection violation: This may be caused by manual alteration of a URL containing a checksum or by using a link with an incorrect or missing checksum. If you are unsure what caused this error, please contact the application administrator for assistance"
    Can i have a custom message here ? An image, or a custom text for a more friendly end-user message
    Thank you very much,
    Srikumar S

    Version of database? Version of APEX? Browsers involved? More information you provide, better response from people here...
    Thank you,
    Tony Miller
    Ruckersville, VA

  • Custom Error message for BI iview

    Hi guys,
    We have configured over 100 BI iviews in Portal which we do not want people to access for a certain period. A simple option we have thought is to remove all permissions on the System connector created for BI which would automatically deny users from accessing it. However, it gives a Portal Runtime Error message, is it possible to custom a message page for it?
    Thanks

    hi wang,
    this is the area u r looking
    http://help.sap.com/saphelp_nw70/helpdata/en/de/893341762ff523e10000000a155106/frameset.htm
    Custom Portal Runtime Error Page
    i wll send one more document to get out of this
    http://help.sap.com/saphelp_nw04s/helpdata/en/9a/e74d426332bd30e10000000a155106/frameset.htm
    Custom Error Pages on Portal
    these u can check for custom messages
    Custom error page - image
    bvr
    Edited by: bvr on Jul 24, 2009 11:18 AM
    Edited by: bvr on Jul 24, 2009 11:22 AM
    Edited by: bvr on Jul 24, 2009 12:24 PM

  • Customized Error Message for User

    What's your recommendation re displaying Customized User Error msg as opposed to the generic, techy #SQLERRM# ?
    How can one implement this ?
    How can one capture #SQLERRM# (or whatever), evaluate the ORA number and display a message grandmom can understand ?
    Please give an example if you can in the context of DELETE a record on P301 "Product Information" of the "Sample App"
    Thanks

    short of coding the dml procs yourself and trapping those error messages that way, i don't think we offer you a good way currently to trap and translate error messages coming out of our automatic DML processes. i've just logged the enhancement request to facilitate this, but for now i'm pretty sure you'd have to code that dml and trap your errs yourself.
    regards,
    raj

  • Custom error message for invalid date format

    Hi,
    I am using af:selectInputDate component for date. When i enter wrong date format it comes up follwoing pop up error message:
    The value "12/13/2009" is not a valid date. Valid example ""29/11/2005".
    However i dont want to show this standard message but a customised error message like "the value is not in correct format...".
    Can anyone help me how can i show customised message.

    Hi Kiran
    Try these options
    1) Change your <b>Internet Explorer</b> [The Browser which you are using] language
    2) In Application Level, ie in Webdynpro
    a)Go to <b><Your project name>>Webdynpro>Applications--><Your Application>
    Double click on your Application name</b>b) Go to Application Properties TAB, Add a New Application Property
    c) Click on "<b>Browse</b>" and Select <b>DefaultLocale</b> and mention the Value as
    <b>en_US</b> [If you didnt mention any thing here by default it will take browser's language]
    3)In your Portal check the language setting of particular user in identity management
    Warm Regards
    Chaitanya.A

  • Custom error messages impossible with jsf ea4??

    Hello,
    Does jsf allow custom error messages for built-in validators?
    I was told by a member of the jsf team that what is described in the tutorial applies only to future versions of jsf.
    Is this a bug? If it isn't and if it is indeed possible to have your own error messages for built-in validators, I would be grateful for someone of the jsf team to help me.
    I have already posted some messages asking for help but I never got any answer.
    Julien

    If a validator wants to add an error message to the current page, it has to call FacesContext.addMessage() with a javax.faces.application.Message argument. The design intent is that you can look up localized messages (defined in the config file) via MessageResources -- that's the part that does not work right now.
    In the interim, though, you can construct your own Message instances by leveraging the MessageImpl class:
    context.addMessage
    (new MessageImpl(Message.SEVERITY_ERROR,
    "You goofed",
    "Here are the gory details..."));
    or look up the message strings from a resource bundle.
    Craig

  • The custom error message in the bank application is displaying in English

    Hello Team,
    The custom error message for a blank institution number in the bank application is displaying in English when the user is logged in French. See attached screen shot.
    ESS --> Personal Information --> Bank Information.
    Could any one let me know the procedure in solving the error. Helpful answer is highly appreciated.
    Thanks,
    Sankar

    Hi,
    sandip is correct, go to SE11 Table T100.
    I did it this way: Searched for (in my case) SPRSL = DE and TEXT = "Bitte Bankschlüssel eingeben" (that's the said error message). With the upcoming result I got the message ID and message Number, these are:
    ARBGB = 'AR' MSGNR = '195'
    ARBGR = '1J' MSGNR ='510'
    Maintain them for your SPRSL and you should be fine.
    regards, Lukas

  • CreateStrategyR3 and ReadStrategyR3 Customized Error Message

    Hi
    We want to display customize error message for the function module SD_SALESDOCUMENT_CREATE.
    the function returns a return structure that has error codes like V1-117, V1-118 etc
    We want to display the customized error message for this code
    so we have made the changes in CreateStrategyR3 and ReadStrategyR3 
    as well as we have placed the customized message in the property file
    but I still cant see customized error message i can see the std error message of SAP
    Can anyone help me out with this
    Regards
    JM

    Hi ,
    Does this approach work for the version 7.0 also?
    I have made changes to ReadStrategyR3, OrderR3, backendobject-config.xml and overriden replaceR3MessageTexts.
    public boolean replaceR3MessageTexts(JCO.Record messageRecord, StringBuffer messageId, StringBuffer text){
              super.replaceR3MessageTexts( messageRecord , messageId, text); is the way i am trying to override it.
    Still the standard message is getting displayed.
    I am trying to capture message V1/150.
    Please help.
    Best regards,
    Rohit Sharma

  • Pop up error messages for failed custom validation

    I am using jdev-10.1.3.4
    My application is in ADF BC
    I am writing custom validation through managed bean, I want pop-up error message for this failed validation.
    My problem scenario is:
    I had some list box as "status"-when this status changes to failed then the other field namely "closed date" should become madantory and also date in closed date field can't be in future.I am able to have all this validation through managed bean and also able to use af:messages through which i am able to print error message on the top of the form, but i am not able to give pop up error message for this failed validation.
    I had gone thru jdev guide but there is nothing like what i am asking.
    it would be of great help if someone can give me some example also.
    thanks in advance.

    ADF has global setting where you can configure the way messages are shown to user:
    You can make this setting in adf-faces-config.xml
    The <client-validation> element controls how client-side converters and validators are run.
    Three values are supported:
    "INLINE": validation is shown inline in a page (the default)
    "ALERT": validation is shown in an Javascript alert
    "DISABLED": validation is only handled on the server
    IN your case, set it to 'ALERT'.

  • How to create a help view for a customized error message

    Hi all,
    Can you guide me how to create a help view for a customized error message, we need to put some suggestions in it so that user can can resolve this issue with this guide. ( the short text is too short to describe all situations via TC:SE91)
    Thanks very much!
    Bruce, Wen

    Hi Bruce,
    Could you brief your concerns again.
    Why don't you maintain long text in message class for long description.
    Regards,
    Ranjith N

  • How to programmatically set an error message for a validation rule of an EO

    Hello,
    Is there a way to programmatically set an error message when validating any data on an EO?
    It seems the API of the EO interface does not have any method to be defined for my needs..
    thanks

    The other option is that for the error message you can define a groovy expression to call an EO method.
    I documented this on my blog
    http://blogs.oracle.com/grantronald/entry/dynamic_error_messages_from_a
    Regards
    Grant

Maybe you are looking for

  • Error during print request output. l_rc = 1

    Hi , I have a request to create on ouput device which can copy the spool request to desired location in application server. Our server is not connected to any physical server and is windows NT. I am tring to create ACCESS TYPE 'L' with host printer n

  • Error when Connect to Oracle using JSP

    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); There is no problem with this code in Java, but when i used it in JSP, the error occured. java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver I am using JRUN Web Server, i do

  • Fields are in disable state

    Hi, I am getting all my fields in disable state...... please help me why i am getting in disable state Thanks& Regards Ravi Shnkar B

  • Changes in Designer not visible in deski

    In Designer I have done some changes to the universe and saved it in local. Now when i try to open the same universe in Deski I am not seeing the changes. Can anyone please let me know how will I check the changes I have done to the local copy. Regar

  • Can I use my Iphone4 in europe  with available power at 220v

    I am taking my Iphone 4 to access my Email in Europe. The power adapter supplied is 120v. Can I use it at 220V supply common in Europe