Need field validation help

I have read the all documentation, but still cannot get what I believe is a simple field validation to work properly. Can somebody assist?
Here is the situation. I have two fields: one is a checkbox and the other an integer field. ( If the integer field is 0 or null ) AND (the checkbox is not checked or null) then we need to show the user an error message. Seems simple. I’m trying to take baby steps to get this to work so I understand it, but have not been successful.
I know the message only triggers if the validation equates to False. I believe that field validations trigger whenever a record is save no matter if the field that has the validation was changed. If this is not correct, please advise.
Starting out simple: I added the follow validation to the checkbox field: [<integerField>] <> 0 The data in the UI clearly shows a 0 in this field, but when I update the record, the error message is not display. Can somebody explain why? Is my syntax wrong?
I need to understand how to correctly compose the field validations and also how to account for ‘null values’.
Any help would be greatly appreciated.
I also tried this on the checkbox field: ( [<checkboxfield>] LTGT 'Y' AND [<Integerfield>] = 0 ) but again it does not display message. LTGT = < >
I wish Oracle had a webnair on how to write field validations. :)
Thanks.

Validation can be a trial and error exercise. There are a couple of key points to remember.<ul><li>First, always check the sytax before saving. This will only catch some very basic issues, but it can helpful.</li><li>Second, always click save for the Field Edit before testing. I know I forget to do this half the time, and it can be frustrating to find out that the validation would have worked if you had saved the change to the field.</li><li>Another key is to allow for the validation to be skipped during integration or by administrators. This can be managed with the ExcludeChannel() and UserValue() functions.</li><li>Finally, there are a couple of key points to be understood about when field validation rules will fire. The following circumstances prevent a field validation expression from being evaluated:<ul><li>A field is left blank when the record is created. Field validation does not force a value to be required.</li><li>A field has a pre-existing invalid value, and it is not changed when it is updated.</li></ul></li></ul>
With all of that said, let's discuss your problem. I think you want the validation to work as follows: <ul><li>If the number is greater than zero, do nothing</li><li>If the number is less than or equal to zero or null, then check to see if the flag is checked. If the flag is checked, do nothing, otherwise give a message.</li></ul>
If that is true, you have a nested IIf statement. The statement would be similar to the one below. This would be for the number field, and you would repeat the same for the checkbox field. Note that in this expression, I am returning the value for the field being validated.
IIf([<IndexedNumber0>] > 0,[<IndexedNumber0>],IIf([<IndexedBoolean0>]='Y',[<IndexedNumber0>],"Invalid"))
Good Luck,
Thom

Similar Messages

  • In LSMW need field validation

    Hi,
    My requirement is adding fields to an existing structure in LSMW batch input method and performing validations on those fields as follows
           1.  Alternative Priority                  should be numeric
           2.  Alternative Starategy              should be numeric
                                                             and valid values are  ‘1’  ‘2’.
            3.  Alt. Usage Probability             should be numeric with no decimals
                                                                  and valid values are 0-100
    Thanking u inadvance,

    if you go to field mapping section(in change mode)
    double clik on the field(where you see the mapping of your source field and the target field) which you need to write the condition, it will open up the editor to write the code. play around there you will get some idea.
    if still you have problems let me know

  • Trying to create a Field Validation Expression and need help

    I have a picklist field and another field that are in question. I want to set some sort of rule that forces the second field to be populated only If specific values are selected from the picklist field.
    I was going the route of a field validation Rule, but everything i've tried so far does not produce the results i am trying to achieve.
    The first type of expression i tried was:
    ([<plProduction_Print_Account_Category_ITAG>] <> LookupValue("OCC_CUST_LOV_ACCOUNT_1", "No Production Print") AND ([<stSIC_Code_ITAG>] IS NULL))
    This is generating the field validation error message when i select any of the correct values from the picklist. the problem is still the second field, which will generate the error if a value is entered into the second field, regardless of the picklist value selected. Switching the "IS NULL" to "IS NOT NULL" only reverses the problem on the second field, causing the error to generate when the second field is updated to a NULL or blank value.
    I also tried :
    = 'No Production Print' AND [<stSIC_Code_ITAG>] IS NOT NULL
    and got similar results.
    ([<plProduction_Print_Account_Category_ITAG>] = LookupValue("OCC_CUST_LOV_ACCOUNT_1", "No Production Print"))
    Similar results as well.
    Does this need to be an IIF statement? Do I need to make this a workflow expression instead? i could really use some help as I have tried everything i can think of and admit, i'm not the expression guru!!!. Any assistance would be appreciated.
    TeknoMan

    Yes we have the same request and we used the following expression. Example we have a field "Método de pago" ( [<plMtodo_de_pago_ITAG<]), it's values are "CHEQUE and DEPOSITO" if we select DEPOSITO three more fields were requiered Route, Sucursal de banco and Clabe so we have to put this validation in the four fields including Metodo de pago.
    [<plMtodo_de_pago_ITAG>] <> "DEPOSITO" OR ([<Route>] IS NOT NULL AND [<nSucursal_de_banco_ITAG>] IS NOT NULL AND [<stCLABE_ITAG>] IS NOT NULL)
    well in the field CLABE we put the following [<plMtodo_de_pago_ITAG>] <> "DEPOSITO" OR ([<Route>] IS NOT NULL AND [<nSucursal_de_banco_ITAG>] IS NOT NULL AND [<stCLABE_ITAG>] IS NOT NULL AND Len([<stCLABE_ITAG>])=18) this was because the len of the value must be 18 characters.
    I hope this works for you
    Regards Catalina Valadez
    Edited by: CatalinaV on 12/03/2009 10:54 AM
    Edited by: CatalinaV on 12/03/2009 10:55 AM

  • Help needed in Validation

    On my page I have two items
    Item 1 is Duration which is an Select List ; containing Month/Quarter as values.
    Item 2 is Val , i need to put value based on Duration ,
    if the duration is Month, put 100 in this field
    if the duration is Quarter, put 500 in this field
    plz help me how to do this ?

    Then create a computation process which will then do it for you:
    BEGIN
    IF :p1_duration = 'Month'
    THEN
    :p1_val := 100;
    ELSIF :p1_duration = 'Quarter'
    THEN
    :p1_val := 500;
    END IF;
    END;
    Denes Kubicek

  • Bypass Required Field Validation when needed in PDF Dynamic Form

    I faced a tricky situation, where some fields are required, but we need to allow bypass required (mandatory) validation rule when saving the form, and require to fill such fields when submitting the form. In other words, provide flexible control when to turn On / Off this feature.
    I wanted to implement a flexible solution, and I will post my findings here. Appreciate your feedback for improvements.
    Steps:
    1. Mark rquired fields as required.
    2. Specify "Empty Message" as "This field cannot be left blank", or similar.
    3. Specify "Validation Script Message" as "This field must have a proper value before submit", or similar.
    4. Create a Global Form Level Variable something like "StopTotalValidation" and default as "1" means by default, Turn Off Validation for some cases.
    5. For the fields which require this type of control, add the script (to be defined later) on the "validate" event:
    myTools.validateForRequiredField(this);
    6. Create a Script Object "myTools" and add the following script:
    function initStringFunc() {
    //call this function on Document Initialize
    String.prototype.trim = function() {
        return this.replace(/^\s+|\s+$/g,"");
    String.prototype.ltrim = function() {
        return this.replace(/^\s+/,"");
    String.prototype.rtrim = function() {
        return this.replace(/\s+$/,"");
    String.prototype.isEmpty = function() {
        return (this == null) || this.trim() == "";
    function setNodeProperty(theNode, theProperty, newValue) {
       if (theNode[theProperty] != newValue) {
            theNode[theProperty] = newValue; 
    function isNodePropertyEmpty(theNode, theProperty) {
        var result;
        if (theNode == null || theNode[theProperty] == null) {
            result = true;
        } else {
            result = theNode[theProperty].isEmpty();
        return result;
    function disableTotalValidation() {
        StopTotalValidation.value = "1";
    function enableTotalValidation() {
        StopTotalValidation.value = "0";
    function isTotalValidationOn() {
        return StopTotalValidation.value != "1";
    function isTotalValidationOff() {
        return StopTotalValidation.value == "1";
    const conRequired = "(required)";
    function validateForRequiredField(theFld) {
        // Bypass Required Field Validation when Global Validation is Off.
        var result=false;
        if (theFld) {
            if (theFld.mandatory && theFld.mandatory == "error") {
                if (myTools.isNodePropertyEmpty(theFld, "rawValue")) {
                    myTools.setNodeProperty(theFld, "rawValue", conRequired);
                if (isTotalValidationOn()) {
                    if (isNodePropertyEmpty(theFld, "rawValue") || theFld.rawValue.toLowerCase() == conRequired.toLowerCase()) {
                        result = false;
                    } else {
                        result = true;
                } else {
                    result = true;             
        } else {
            result = false;
        return result;
    7. Now, on the click of "Save" button call the function "disableTotalValidation()" and on the click of "Submit" button call the function "enableTotalValidation()".
    I have just finished implementing the above solution, and as per my initial testing, it is working fine.
    I will post this to my Google Docs workspace, and provide updates their.
    Tarek.

    Hi Tarek,
    I see what you mean in relation to clarity if you used the form variable approach. It was only a suggestion. Like so many things in LC, there is more than one way to finding a solution to a problem.
    The triple equal sign (===) is testing if the condition is equal, but to a higher standard. It is testing if the values are identical to each other. For example if you were testing if a textfield was empty, with Equality (==) you might have this:
    if (this.rawValue == null || this.rawValue == "") {
         // Some script
    If you use Identity (===) you can do the same thing with less script:
    if (this.rawValue === null) {
         // Some script
    It is also useful when testing the value of an object, but also the type (eg string, number, Boolean).
    Lastly, it can be used for non-identity (!==).
    In relation to createNode() etc, apart from John's blog, it is covered in the LC documents: http://www.adobe.com/support/documentation/en/livecycle/documentation.html. Look for the scripting guides and the guide to the XML Form Object Model.
    Good luck,
    Niall

  • Advanced Field Validation Needed ASAP

    This app is great but you really need to add some more detailed field validation options.  There isn't even a phone number field validation.  Users can put in the data any way they want and that is unacceptable.  For $144 per year I expect to be able to validate the field content.

    I'm bumping this back up to the top.
    Field validation is a basic function of any professional form.  For example the phone numbers submitted by form users need to be in a standard format. Without validation they can be submitted as xxxxxxxxxx, (xxx) xxx-xxxx, xxx-xxx-xxxx, etc.  When the responses are viewed that column will be a mess.  I was hoping to avoid the step of saving the responses as an MS Excel file but that is the only way I can see to format the phone numbers.
    Please tell me how I can create a form field that forces users to enter a phone number in a specific format WITHOUT some kind of field validation. 

  • HT2731 i hav iphone and i restart it and delete all the files inside how can i start again my iphoe it say i need a valid sim with no pin lock to activate it again pls help

    i hav iphone and i restart it and delete all the files inside how can i start it again it say i need a valid sim with no pin lock to activate iphone again

    ICCID unknown is a critical failure, usually caused by hacking or jailbreaking the phone. It can not be fixed. The phone will need to be replaced.

  • Mandatory field validation on Page links.

    We have created a Portal application where we included different applications as taskflows. We have also created a tabbed interface which helps us to communicate from one task flow to another taskflow. When we are in one page of taskflow and try to move to another page of different taskflow using tabbed interface we receive mandatory field validation error which prevents us to move to any other page until we fill all the mandatory fields. We need to move to different page of taskflow by using the tabbed interface even without filling all the necessary mandatory fields. Can anyone help us to resolve this issue as this is very important for our project.

    <b>Layout</b>
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content design="design2003" >
      <htmlb:page title="Check Pernr " >
        <htmlb:form>
          <htmlb:textView text   = "Personnel No."
                          design = "EMPHASIZED" />
          <htmlb:inputField id    = "pernr"
                            value = "<%= lv_pernr %>" />
    <%
    if lv_no_pernr = 'X'.
    %>
    <script language="Javascript">
    alert ("Personnel no. is not Valid")
    </script>
    <%endif.%>
       </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    <b>ONINPUTPROCESSING</b>
    DATA: l_pernr TYPE persno.
      DATA: data TYPE REF TO cl_htmlb_inputfield.
      data ?= cl_htmlb_manager=>get_data( request = runtime->server->request
                                             name     = 'inputField'
                                             id       = 'pernr' ).
      IF data IS NOT INITIAL.
        l_pernr = data->value.
      ENDIF.
    CLEAR lv_no_pernr.
    SELECT SINGLE pernr FROM pa0000 INTO l_pernr WHERE pernr EQ lv_pernr.
    IF sy-subrc NE 0.
      lv_no_pernr = 'X'.
    ENDIF.
    <b>PAGE ATTRIBUTES</b>
    lv_no_pernr     TYPE     FLAG
    lv_pernr     TYPE     PERSNO
    hope this helps.
    A

  • Field validation in table maintenance generator and input value grey out.

    i have created ztable with 3 fields as em_no,em_no and addrnumber.
    first two fields are custom fields but the third custom field need to validate the standard table adrc contains the value of the field addrnumber.
    i need the query of field validation query which we write in create entry events in table maintenance generator and also if we give wrong value for addrnumber in sm30 maintain table, the input field need not to be grey out for next entry...
    please help.

    Hi,
    create method -
    >before saving data.....write the logic between the method
    go to utilities->table maintanance ,,,after creating generator ---go to envirnment->modification->events.
    create event -.>.as zsave select event  type 1(before saving data to table) write code in include....
    consider data for field3 is 10 .
    lv_new = ztbr(table name)-field3.
    select field3  from ADRC(ZTABLE) into wa_new (TYPE ZTABLE) where field3 = lv_new.
    if sy-subrc = 0.
         working fine
         else.
        message  i888(sabapdocu) with 'data invalid'.
    endform.
    This will help u...
    Thank u.........

  • Additional field validation

    Hi,
    for example - I have a table element and one of its coloums is of type TIME. The automatic field validation (only valid times allowed) is working fine, but now i need to check that only full and half hours are entered. So if the user enteres "11:11" in a row I want this input-cell to be displayed with a red border and a message to be displayed.
    I can check and show a message, but how to highlight that special cell?
    Can I assign additional value checks to a context node and how to do this?
    Whats the best approach?
    Thanks for any help,
    Stefan.

    Hi Stefan,
    As how pointed out by Karri you can make use of the report_attribute_error_message to throw an error message and highlight a particular cell of the table as well. Try going through this [link|editable ALV - how to throw an error message for a specific line & field; in which Andreas was trying to validate & highlight an ALV's cell with the same report_attribute_error_message.
    Regards,
    Uday
    CALL METHOD lo_message_manager->report_attribute_error_message
              EXPORTING
                message_text   = 'Sample message text'
                element        = lr_element " Reference of type if_wd_context_element to the cell u want to highlight
                attribute_name = ls_modified_cells-attribute. " The context attribute name to which the column of this cell is bound to

  • Picklist Field Validation

    Hi all, I'm really new at building validation expressions so I thought I could get some help here...
    I have two picklist fields. The second field should be required depending on the value of the first field. If FIELD1 is = "value1" then a value must be selected from FIELD2 (it can't be null) otherwise FIELD2 can be null. Here is the expression that I tried to build and clearly is not working... :(
    Consider that I'm using a workaround for the fact that field validations for null values don't work when a new record is created so for this workaround... On FIELD2 configuration, the Default Value is '*' and the Post Default checkbox is checked.
    The field validation expression is:
    <> '*' AND Len([<FIELD1_ITAG>]) > 0 AND LookupValue("FIELD2", "value1")
    I appreciate any help !
    Thanks
    Cristina

    You might need to try something simpler like:
    Field 1 validation: Field1 = Value1 AND Field2 IS NOT NULL OR Field1 [not equal] Value1
    Field 2 validation: blank
    and if you're very concerned about the second field being validated then put the same as field1 validation.
    Field 2 validation: Field1 = Value1 AND Field2 IS NOT NULL OR Field1 [not equal] Value1
    Also, the workaround thing with the star * seems totally unnecessary.

  • Hi gurus how to provide the table field validations

    hi gurus how to provide the table field validations , plz help me

    Hi,
          Say you need to provide valdiation for WERKS(Plant) field.
    Goto SE11. Find the domain of the field. (Say WERKS in our case.) now goto the domain, click on value range. Now at the bottom you will find the value table. Note this table (T001W).
    In your report, at selection screen, you need to validate the field against this table. like this
    At selection-screen,
    select single werks from T001W where werks = p_werks.
    if sy-subrc NE 0
    message e000 with 'Plant not found'.
    endif.
    Reward points if useful.

  • SBL-DAT-00398 error msg for User Field Validation

    Hi All,
    I have created the following field validation on the User field "Division": Len([<Division>])>0 AND InStr([<ltValidation_OU_ITAG>],[<Division>])>0, As the "Division" field is free text, the porpuse of the validation is to prevent the user from entering in this field any value that is diffrent from the ones available in the custom field "Validation OU" via the User Owner Page Layout. The validation works OK for Admin Role via the User Admin Page Layout but a SBL-DAT-00398 error msg stating " Field '<Division>' does not exist in definition for business component 'Occam Current Employee' " appears when users with other roles are trying to update this field via the User Owner Page Layout.
    I have contacted OD Customer support and they validated this in several POD saying this "is most likely a defect in the application" and a CR will be submitted to dev team to fix it sometime in the future.
    I am wondering though if support isn't making life easy here stating the above...:
    1. Anyone encountered this error before? (couldn't find any trace for this on My Oracle Support)
    2. Anyone aware of field validation limitations for the 'User' entity?
    3. Workaround suggestions are welcomed
    10X for you help!
    Alex.

    Error(), fatal(), info() and warn() issue FacesMessages that get picked up by the MessageGroup component.
    By adding in the uicomponent you can target the facesMessage so that it gets picked up by the Message component associated with the field causing the error.
    But, to get the label to show the error as well, you need to throw a validationError. See this tutorial for more informaiton:
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/customvalidator.html
    Lark

  • Field validation regular expression to accept only numbers

    Hello.
    I would like to have a field validation regular expression to accept only numbers - no characters. The list of pre-packaged regular expressions that are included with ApEx does not contain this and I am not a very good regular expression writer. Can anyone help?
    Thanks!
    Boris

    Under the Regular Expression validation all you need to have is:
    ^[[:digit:]]$For the email address it just depends how detailed you want it:
    ^((?>[a-zA-Z\d!#$%&'*+\-/=?^_`{|}~]+\x20*|"((?=[\x01-\x7f])[^"\\]|\\[\x01-\x7f])*"\x20*)*(?<angle><))?((?!\.)(?>\.?[a-zA-Z\d!#$%&'*+\-/=?^_`{|}~]+)+|"((?=[\x01-\x7f])[^"\\]|\\[\x01-\x7f])*")@(((?!-)[a-zA-Z\d\-]+(?<!-)\.)+[a-zA-Z]{2,}|\[(((?(?<!\[)\.)(25[0-5]|2[0-4]\d|[01]?\d?\d)){4}|[a-zA-Z\d\-]*[a-zA-Z\d]:((?=[\x01-\x7f])[^\\\[\]]|\\[\x01-\x7f])+)\])(?(angle)>)$or...
    [\w-]+@([\w-]+\.)+[\w-]+Hope these help
    Edited by: MikesHotRod on Sep 3, 2008 12:40 PM

  • Change "isDate" field validation format?

    The isDate field validation format in the Forms wizard shows an error when the date is not in the format DD-MON-YY format. I would like for it to check for the format MM/DD/YYYY and give an error message for this format, not the DD-MON-YY format. Any help would be appreciate.
    --Jim Bladen                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi,
    to attach the format depending on the country selection, I
    think is a little more difficult to be done, is not enough only to
    declare a new widget constructor in page and then to access it.
    To have this behavior, is need to call addEventListener
    function when the onchange event is triggered. It should be
    something like this:
    Spry.Widget.Utils.addEventListener('country_id', 'onchange',
    function(e) {
    // here you should get the selected country
    // then you should destroy the initial validation object that
    hadn't a format attached
    //and finally you should declare a new validation object that
    contains the format according the country you selected.
    I didn't tested if the solution above works, but I think this
    is the approach for getting the behavior you want.
    Diana

Maybe you are looking for

  • External boot up disk PPC versus Intel

    I am currently travelling with an external HD that is a clone of my G5 PPC iMac. It has a fully functioning OS 10.4.11 on it and I can use it as a boot up disk. I normally stay with a friend who has a PPC Mac, and can boot up using this HD so that it

  • Drop down menu for a list

    Hi, I need to create a type of drop down menu for a navigation list. Only one button needs a drop down option. I was wondering if anyone had any suggestion on the best way to go about it? Is there a way to make the list that drops down to the right i

  • Where has all the 'help' gone?

    I just commented on an earlier thread about the sudden disapearance of  online "help" from within Photoshop CS4. Why? Now when I click on Help I get routed to a generic Adobe page where I have to burrow down through newer versions to find CS4, then h

  • Can't get Quicktime HD movie files to run smoothly on my iMac G3

    I've got a slot loading imac crt/ G3 933mhz 596mb of ram; and updated it to tiger and quicktime 7 pro. Everything was fine. I marvelled at HD quicktime movies and videos in iTunes, but all of a sudden, any new hd files I download from iTunes or the q

  • Roaming profile in multiple servers and multiple locations

    I am planning to keep our roaming profile in Primary Domain Controller and when it fails it has to get the profile from Child Domain Controller. The child dc can be in the same location or in any branch location. Could I have the configuration steps?