Validation error on numeric field

Hi, I am very new to Oracle Database and have only recently started learning SQL, PL/SQL and Apex.
I have created a very simple stock control application with a report that lists the quantity of parts in locations with a button on each row that allows the user to "Take Out" a quantity of that part from the location. When you click this button a new form is displayed (showing as read-only fields) the information of the selected part loaded from the database including the "Current Quantity" and a new number field "Take Out Quantity" which is the only field the user can edit.
I have added some simple validation to prevent the user from entering a "Take Out Quantity" that is greater than the "Current Quantity" (which would in the real world be impossible as you cannot have a negative quantity of an item). My code is as follows:
if :P11_TOQUANTITY > :P11_CURRQTY then
return false;
else
return true;
end if;
however I get some very strange results in that it appears to only validate against the first digit of the current quantity. e.g.
Current Quantity = 54
New Quantity = 6 Returns an error
but
Current Quantity = 54
New Quantity = 5 is ok
In fact I can enter any number <= 5 but cannot enter number greater than 5 but I should be able to enter any number <= 54
Can any one suggest what I might be doing wrong?
Thanks
Richard

Thanks Alex,
That's great, I have done as you suggested and it works perfectly now. I knew it was something simple but I just could not work out what. I didn't realise that all fields on the page are considered as strings.
As a result I also tried to change my other protected fields on the screen from Display As Text Field to Display Only and changed Read Only Condition Type from always to none but then it doesn't work properly as the screen seems to lose the values once I enter a "Take Out" value and press the submit button causing the validation to fail. So I assume I had done it correctly the first time?

Similar Messages

  • Using LOV with Validation on the Numeric Fields results in Error

    Dear JHeadstart Team,
    During my work with lov I encountered another problem. I defined a lov and attached the lov to a numeric field and check the LOV for validation. Now when I use LOV using the LOV button it works fine but when I enter some numbers and then press tab the LOV was not shown correctly and resulted in the following errors and the worst thing is that you can not navigate to any other pages and all try to navigate to other pages results in errors too. When we put the same LOV on a string field (which is not desirable for us) it worked fine.
    It seems to me like a bug. Am I right? Is ther any solution or workaround for this problem?
    Thanks in advance,
    Navid
    16:31:29 DEBUG (LovItemBean) -Cleared value of item HrTrainingCourseSchedulesTitle
    16:31:29 DEBUG (LovItemBean) -Cleared value binding #{bindings.HrTrainingCourseSchedulesTitle.inputValue} of item HrTrainingCourseSchedulesTitle
    16:31:29 ERROR (ApplyRequestValuesPhase) -java.lang.ClassCastException: java.lang.Long
    javax.faces.el.EvaluationException: java.lang.ClassCastException: java.lang.Long
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:130)
         at oracle.adf.view.faces.component.UIXComponentBase.__broadcast(UIXComponentBase.java:1079)
         at oracle.adf.view.faces.component.UIXEditableValue.broadcast(UIXEditableValue.java:247)
         at oracle.adf.view.faces.component.UIXSelectInput.broadcast(UIXSelectInput.java:215)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:249)
         at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:307)
         at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:79)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at com.pooya.controller.jsf.PooyaAuthenticationFilter.doFilter(PooyaAuthenticationFilter.java:256)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:332)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)
         at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:627)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.ClassCastException: java.lang.Long
         at oracle.jheadstart.controller.jsf.bean.LovItemBean.validateWithLov(LovItemBean.java:101)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
         ... 31 more

    Hi Navid,
    We ran into the same bug and have the next workaround for it:
    We extended the JHeadstart class 'LovItemBean' and we have overridden the method 'validateWithLov(...)' with:
      public void validateWithLov(ValueChangeEvent valueChangeEvent)
        Object newValue = valueChangeEvent.getNewValue();
        if(newValue != null && !(newValue instanceof String))
          newValue = newValue.toString();
          ValueChangeEvent newEvent = new ValueChangeEvent(valueChangeEvent.getComponent(), valueChangeEvent.getOldValue(), newValue);
          newEvent.setPhaseId(valueChangeEvent.getPhaseId());
          super.validateWithLov(newEvent);
        else
          super.validateWithLov(valueChangeEvent);
      }Next step is to use a custom template in your JHeaedstart Application Structure file for 'LOV_ITEM_BEAN'. In this custom template you should use your own class as 'managed-bean-class' instead of the default JHeadstart one.
    Now you can safely generate LOV with validation of number fields.
    Maybe something the JHeadstart can pcik up in the next release of JHeadstart :-)
    Hope this helps.
    Pascal

  • Form validation error with mandatory fields and signature field

    Hello,
    I have seen that many other users are facing this issue, and they partialy do solve it with some workarounds. However, none of them applies to my case.
    I have a dynamic form (can be registration form for example) where user fills in bunch of fields. Some of them are mandatory.
    When user signs the form, I get our favourite validation error popups that filed this and this did not validate. (I think that the signature is not valid too once I get these errors).
    Workaround would be to set all fileds in the form as optional, however, the presign and postsign events work only in A9 and I need the form to be compatible with ver. 8 too.
    I also need to make sure, that they are not set to optional, if the signing fails, user clicks on cancel etc...
    Any ideas how to acomplish such a scenario?
    Thanks
    J.

    solved by myself.
    You have to install and configure the reader rights credentials mentioned in note 736902

  • Numeric field validation in Report Field

    How we can have the validation check for numeric field in report ?
    please help me on this

    Hi,
    Try creating a function that returns either 0 or 1 depending on whether or not the value is numeric and then handle the result accordingly.
    Something like:
    CREATE OR REPLACE FUNCTION IS_NUMBER(p_string IN VARCHAR2) RETURN NUMBER
    AS
    vNUMBER NUMBER;
    BEGIN
    SELECT TO_NUMBER(p_string) INTO vNUMBER FROM DUAL;
    RETURN 1;
    EXCEPTION WHEN OTHERS THEN
    RETURN 0;
    END;Then create a PL/SQL process that loops through your data. Something like:
    BEGIN
    FOR x IN 1..APEX_APPLICATION.G_F01.COUNT
    LOOP
      IF IS_NUMBER(APEX_APPLICATION.G_F01(x)) = 0 THEN
       ... do something if the value is not numeric ...
      END IF;
    END LOOP;
    END;Andy

  • Mandatory field validation error occurs when user cancels out of blank "cre

    Hi - I'm building an application using Oracle 10g 9.0.5.2, with ADF/UIX/Struts.
    I followed the technique described in the tutorial
    http://otn.oracle.com/obe/obe9051jdev/uixtutorial/lesson_uix.htm
    In that example they have a page called BrowseDeptEmp. On this page is a
    create button, which is linked to a /createEmpAction before displaying the
    FormEmp uix page, where the user is supposed to enter new employee data.
    So I did the same thing, but I added a cancel button on the FormEmp.uix page.
    If the user presses cancel on the FormEmp page, it goes through a 'rollback' DataAction (with a rollback operation dragged on it) and then back
    to the main page.
    here's my problem:
    If the user
    1. clicks the create button on the BrowseDeptEmp page
    2. Sees the blank form in the FormEmp page
    3. Changes his mind (does not want to add a new employee) and clicks cancel
    The FormEmp page displays validation errors on the fields that are mandatory in the DB! So the user
    can't cancel out of the create page unless he fills in the mandatory fields...!!
    How do I cancel out of a create page 1) without entering any data on the page and 2) without getting
    mandatory field validation messages?
    It must be simple but i can't figure it out....
    Please help :)
    Thanks
    Des

    I don't understand how this can happen if the user has not entered any data.
    Is there a commit action somewhere that is being triggered before the rollback?
    is your cancel button a submit button?
    one way to fix this is to convert the submit button into a
    regular button and have the regular button go directly to your DataAction (the one with the rollback).
    you can automatically create this button by drawing a pageLink from the page to the DataAction in the page flow diagram.

  • Read-only radio group losing value on validation error

    It took quite a while to track this down, but I think I've got it narrowed down properly. I have an APEX form for updating a record in a databse table with a radio group which is conditionally read-only. If that radio group has a value AND is read-only, when the form is submitted and hits a validation error, the value of the radio group is lost.
    For example, the radio group SUBMITTED_FOR_APPROVAL is set to Y and is read-only for a given user. That user then changes something else on the form and submits it. However, the form now hits a validation error for some field. When the form reloads with the validation error displayed, all the fields are restored except the read-only radio group which is now blank. If a select list is used with the identical read-only condition, it works fine. Likewise, if a radio group is used, but the read-only condition is removed, it works fine. It is only when it is a radio group and it is read-only, that the value does not appear to be submitted to the session with all the form values whent he form is submitted.
    Is this a bug or am I simply missing something?
    Apex 3.1.2
    Rgds/Mark M.

    It's using a shared component LOV cleverly called LOV_YN which consists of a static LOV with
    1 Display=Yes, Return=Y
    2 Display=No, Return=N
    The settings in the LOV section on the item iteself:
    Named LOV: LOV_YN
    Display Extra values: No Dynamic translation: Not translated
    Number of columns: 2 Display null: No
    Null display value is blank as is null return value
    Item was setup as a radio group and was only converted over to a select list to work around this issue. Let me know what else you need and thanks again.
    Rgds/Mark M.

  • I have to validate a numeric field in LC so that it is a 1, 2 or 3.

    Is there a pattern I can use or do I have to create a custom script? If I
    use this:
    this.rawValue
    >= 0 && this.rawValue <= 3;
    if 
    (this.rawValue < 1) {this.rawValue
    = 0;}
    if 
    (this.rawValue > 3) {this.rawValue
    = 0;}
    I get a validation error for every field (70 of them) when the form opens and there is a message box on each filed. I tried a default value of 0 for each field but still get the message.
    The field can be null, 0 (when turned off) ot 1,2 or 3.

    When I change the value to null, the validation messages are not displaying..
    if(this.rawValue <1) {
      this.rawValue= null;
    if(this.rawValue > 3) {
      this.rawValue= null;
    Will this help?
    Patterns only check for whether the user is entering the input in a particular format. You may not be able to place script as part of pattern.
    Make this script as part of a Scrip Object and call the script in all of the fields where ever you need. That way script maintenance will be easier.
    Thanks
    Srini

  • Error when converting a numeric field to XML

    Hi,
            When i run the Adobe intractive form,i am getting following exception
    "Error when converting a numeric field to XML"
    Anyone plz suggest
    Regards,
    vinoth

    Hi Vinoth Raja,
    For resolving the following exception
    "Error when converting a numeric field to XML"
    You have to follow the below link:-
    http://www.saptechies.com/error-when-converting-numeric-field-xml/
    May be it will help you
    Regards,
    Sushma Yadav

  • Need help for "Numeric field Overflow" error in excel 2003.

    Hello,
    a friend of mine have a problem exporting Business Objects 5.1.8 to excel 2003 (turning on windows 2000).
    Each time she want to export her reporting in excel format (.XLS), she obtain a "Numeric field Overflow (3349)" error.
    So, she export in .CSV format, but it's not easy to use for her following tasks.
    What could she do ?
    Does she do an "update" to newer version of B.O., or there are a solution at her problem ??
    Thanks in advance.
    Nicolas
    P.S.: I searched for solution on this forum, but found nothing.
    Edited by: Nicolas Kowarski on Sep 28, 2008 10:16 PM

    Hello Nicolas,
    Please post this query to the [Legacy Products|SAP BusinessObjects BI Legacy Products;  forum.
    That forum is dedicated to topics related to legacy products such as Business Objects Enterprise 5.x and 6.x.
    The forum is monitored by qualified technicians and you will get a faster response there.
    Also, all Legacy Product queries remain in one place and thus can be easily searched in one place.
    Thanks a lot,
    Falk

  • Validation error appearing for the wrong field

    Hi friends
    i am facing aissue with my application
    I have 3 Field
    1.     Department (Field 1)
    2.     Emp id(Field 2)
    3.     Name(Field 3)
    If i am not giving Field 1 value and trying to save i am getting proper error message.
    If I am giving Field 1 value and not giving Field 2 value , then I am getting error message for Field 2 in Field 1 .
    If am giving Field 1 and Field 2 value and not giving Field 3 value , I am getting the error for Field 3 in Field 1.
    validation in Entity level.
    i am using jdev11.1.1.6.0, adf faces and adf bc.
    Edited by: 964331 on Oct 22, 2012 3:21 AM

    Hi,
    See followings
    https://blogs.oracle.com/workingwithadf/entry/adf-bc_business_rulesvalidation_eovo
    http://one-size-doesnt-fit-all.blogspot.com/2007/08/jdev-11g-new-features-adf-bc-entity_06.html

  • No message for validation error "format", type "date", field "date-expired"

    Dear
    Guys,
    i am getting the following error : ((No message for validation error "format", type "date", field "date-expired"))
    When trying to upload adobe connect 7 license to the adobe connect 7 configuration wizard. the problem occurs because my server was install on Arabic Saudi Arabia date format while installation, but if i change the windows date format to US then the problem still occurs, and formatting windows is not possible, could anybody help??
    Regards

    Thank you for replying,
    No i am not on host mode, a have installed it deferent times ago successfully, but the only problem now is that during the installation windows server 2008 the default language, time and date. Was set Arabic Saudi Arabia. And even changing it does not solve the problem, as i mentioned above.

  • Validation Error in complaint search with changed on field.

    Hi all,
    I have added changed on field in complaint search screen of IC agent role, while searching for a complaint using changed on field, data as last month. We are getting an error message saying "Date M+-1 is invalid". Which I am suspecting as an validation error. Please also refer if any notes.
    FYR, Error is attached. Fast responses are highly appreciated.
    Thanks,
    Vivek.

    Hi Vivek,
      Your intention is need  to find the error validation?
      If that could be the case,then we can check from where that error message is coming!!
    1. Add a parameter in su3 BSPWD_USER_LEVEL and value is 8. If you go to web ui and place the cursor in error message, it will display the message class and message number.
    2. Then go to SE91 and put the class and number, check where used list. So that u can easily find the code logic beyond that field validation.
    Reply if u need more!!!
    Regards,
    Sugan.

  • Adobe changes my numeric field to include commas when validation fails

    Adobe changes my numeric field to include commas when validation fails. My numeric validation setting is num{zzzzzzz9.99}. I want my numeric field to display as 99999999.00, no commas and only to have 2 decimals places. I added this validation to the Display, Edit, Validation and Data tabs under the validation pattern dialog box.
    When validation fails, adobe changes the display of the field to include commas and drops the decimal places:
    999,999,999
    How can I prevent this from happening? Any feedback is greatly appreciated.
    I've also added a change event to the field as well:
    \\only allows numbers and period.
    if (xfa.event.newText.match(/[^0-9.]/))
    xfa.event.change = "";
    \\only allows 11 characters to be entered.
    var maxLength = 11;
    if(xfa.event.newText.length >maxLength)xfa.event.change = "";

    I want it to display only numbers followed by 2 decimal places.
    999999999.00
    If I type all numbers in my field like 999999999999 and I go over the character limit of 11. My validation fails and then my numeric field is displayed with commas, 999,999,999 without the 2 decimal places. Is there a way to prevent adobe from automatically changing my fields?

  • Parts Requirement Create Order Error:Validation Failed for the field - Shipping Method DHL

    Trying to create Parts Requirement.
    Error message on clicking "Create Order" button: "Validation Failed for the field - Shipping Method DHL"
    Please suggest the Setup that needs to be done for this.

    Kinck
    The same script worked for me in vision (R12.1). You may have issues with your defaulting of a number of attributes that you are not passing in the API (like price list, line type and so on). You may want to check them.
    Thanks
    Nagamohan

  • Script for validating Text fields or numeric fields

    I'm looking for a simple script that will check the entered data in a specific field.If i enter numbers in the name/last name field i should get a pop up message that entering numbers in this field are not allowed.
    (And vice versa regarding numeric fields).
    What is the script for that ?

    Hi,
    try this:
    //var reg = /^\d+$/;    // checks whether input contains ONLY digits
    var reg = /\d+/;    // checks whether input contains digits AND letters
    var check = reg.exec(xfa.resolveNode("#subform[0].#field[0]").rawValue);
    if (check == null)
        app.alert("Everything's fine!");
    else
        app.alert("Entering digits is not allowed!");
    You may want to replace
    #subform[0] with the name of the subform the field to check is located in and
    #field[0] with the name of the field to check for digits.
    Also, you may want to select any of the regular expressions, which fits best your needs. See comment in the above code-fragement for further information.
    Regards,
    Steve

Maybe you are looking for

  • IPod Nano wont turn on

    I have had my Ipod nano for about 2 yrs , and i take good care of it: but suddenly one day it works then the next i cant even turn it on. I have attempted to charge it in a few docks but nothing happens, it is just dead. I have tried all the reset te

  • [svn] 3319: Adding support for documentation of SkinStates metadata.

    Revision: 3319 Author: [email protected] Date: 2008-09-23 13:29:09 -0700 (Tue, 23 Sep 2008) Log Message: Adding support for documentation of SkinStates metadata. xslt files still needs to be updated to generate html for this metadata. Removing some u

  • Java - Shared archive: sharing disabled for server vm ?

    Hi, My mac is PowerMac G5(1.8Ghz) + leopard server 10.5.1. I have a question. After typing *java -version*, the following messages are shown. *Shared archive: sharing disabled for server vm* *java version "1.5.0_13"* *Java(TM) 2 Runtime Environment,

  • PHP, MSSQL 2000, SERVER 2003 and FLEX 2

    Hi everyone, I tried to connect to MSSQL using PHP. I did not get any error message but the only problem is when I try to test the problem, I get this error message. Everything works fine on my local computer "developer", but when I try to program an

  • Organizing music in my library

    Hello, i'm really confused about the way itunes sorts music, and whether it can be changed or not. So, in my library, there are the columns one uses for sorting, such as Name, Artist, Album etc. I generally have it set to artist. However, under the "