Field validation - make field required based on value of another field

Hi,
I tried to enter the field validation into both LeadSource and stSource_Detail field, however, when the LeadSource is not "Customer" or "Staff" and Source Detail is not empty, the validation message will prompt. Below is my field validation:
IIf(([<LeadSource>]=LookupValue("OCCAM_LEAD_SOURCE", "Customer") OR [<LeadSource>]=LookupValue("OCCAM_LEAD_SOURCE", "Staff")) AND [<stSource_Detail_Staff_ID__Customer_ID_ITAG>] IS NULL,N,[<stSource_Detail_Staff_ID__Customer_ID_ITAG>])

Field Validation statements must return only TRUE or FALSE. Rewrite your statement such that if your condition is valid, true is returned, and if not, false is returned.
Thom

Similar Messages

  • Make a field required based on input in another field

    So I have researched the forum to answer the question of how to make certain fields in a form required if a value is entered in another designated field, and not required if no value is entered in the designated field.
    For example:
    There is a field titled QTY_paper, and if a value is entered into QTY_paper, then the field PROGRow1 should become required.
    If no value is entered into QTY_paper, then PROGRow1 is not required.
    I've tried both FormCalc and Javascript, but with no results. In FormCalc I added this script as a mouseExit event on QTY_paper:
    if ($.isNull == 0) then
         //Make the budget field Required
         PROGRow1.validate.nullTest = "error";
    endif
    and then I added this script in FormCalc to the mouseExit event on PROGRow1:
    if ($.isNull == 0) then
    $.validate.nullTest = "disabled"
    endif
    This came almost verbatim from another post on the forum, so I'm thinking I'm missing something obvious here... which isn't too odd as I'm still pretty new at adding the scripts. Please help if you can!

    You'd want to combine both scripts on the first field with an if/else statement. And I'd use the Exit event instead of Mouse Exit (not sure if Mouse Exit handles tabbing in and out of fields).
    The first script should have worked, but with the second script you were asking if PROGRow1 was null, not QTY_paper.
    FormCalc:
    if ($.isNull) then
         PROGRow1.validate.nullTest = "error"
    else
         PROGRow1.validate.nullTest = "disabled"
    endif

  • Field Validation on Custom Obj. 4:  Value of one field making other Req.

    Hello All,
    I have been working on a field validation problem for a while. I have a custom Picklist on CO4. This picklist has two values YES and NO (a checkbox does not meet requirements). What I need to do is If Picklist='YES' then FieldA, FieldB, and FieldC are Required else they are not required. FieldA = Text (short), FieldB = Date, and FieldC = Currency. I've tried numerous ways to validate on Fields A, B, and C with statements like IIf(Picklist=LookupValue(Picklist,"YES"),FieldA<>NULL,FieldA) or IIf(FieldValue(Picklist)="YES",FieldA<>NULL,FieldA) etc... these were just my latest attempts at this point I'm jsut trying random things to try to get it working. I am probably using incorrect syntax (even though it passes the sytax checker). If anyone has any suggestion let me know. Also if I haven't made clear what it is I'm attempting to do let me know and I'll try to clarify.
    Thanks,
    Z

    Hi,
    if I understand correctly, you want this functionality:
    If Picklist = NO => it doesn't matter what values are contained in Field A, B and C.
    If Picklist = YES => Field A is not null and Field B is not null and Field C is not null
    To trigger the validation when the picklist value changes then you have to configure the Field Validation for the Picklist:
    [<Picklist>]=LookupValue("Picklist","NO") OR ( Len([<Field_A>])>0 AND Len([<Field_B>])>0 AND Len([<Field_C>])>0 )
    You have to put the validation also on Field_A and Field_B and Field_C, because in case of an update of , let's say, Field_B, you should prevent that Field_B is blanked.
    If someone updates only Field_B and he doesn't change the value of the Picklist, the validation expression put on the Picklist is not evaluated.
    Simona

  • How to display f4 help for a field based on value of another field

    Hello All,
    I have 4 fields : Sales Org : VBAK-VKORG, Distrib Channel : RV50A-VTWEG, Div : RV50A-SPART, Sold-to-party : KUAGV-KUNNR.
    The second field depends on the first one, the third on the second one and the fourth on the first field.
    However, when each of the second third and fourth fields' f4 help is displayed, the values are independent of the previous fields. How do I set the f4 help to display values based on the respective fields?
    Regards,
    Mithun

    Please be sure that you are searching the forums before posting. This exact same question was asked just yesterday:
    F4 help to input field
    In particular study the section and the linked help document for ddic search helps export/importing parameters and the requirements for DDic Structure/table usage for the parameter mapping.

  • Populate f4 values of a field based on value of other field

    Hi,
    I have created select options using WDR_SELECT_OPTIONS.For one of the fields ,f4 values should be based on value of another field in the screen.
    How will i achceive this requirement.
    I got a link about the same but that is not using WDR_SELECT_OPTIONS
    http://www.sdn.sap.com/irj/scn/logon?redirect=/irj/scn/wiki?path=/display/WDABAP/Using%20Search%20help%20attachments%20for%20WebDynpro%20ABAP
    I got another link
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/606288d6-04c6-2c10-b5ae-a240304c88ea?quicklink=index&overridelayout=true
    which I am going to try
    Thanks
    Bala Duvvuri
    Edited by: Bala Duvvuri on Jun 22, 2011 6:49 AM

    Hi,
    Using OVS you can achieve this.,  In OVS Event Handler read the value based on which you  want to display F4 for other field and populate the values based on the first field.
    this link is fine., go through this: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/606288d6-04c6-2c10-b5ae-a240304c88ea?quicklink=index&overridelayout=true
    hope this helps u.,
    Thanks & Regards,
    Kiran

  • Fields required based on a value in another field

    Hi,
    I am looking to have fields required (Annual Revenues and # of Employees) based on the value of another field (Ownership). Basically, if the value is Public the user is required to enter the Annual Revenue and Employees fields. I thought about using dynamic layouts but the only key field for Accounts is Account Type.
    Thanks,
    Caryn

    Hi Caryn!
    I think it is not possible for making #Employees and Revenues required depending on Ownership(as it is a look up field).. it should be possible if you want to do it on any other criteria other than ownership by just renaming the Account Type, Disable all the values of Account Tyope add new values to Pick List and make it driving picklist upon your requirements..
    If you require Account Type, create a custom picklist "Account-Type" and add the values.

  • Show / hide field based on text in another field

    Hi,
    I'm trying to make one of my fields reactive to what is the text generated in another field.
    At the moment I have this under calculate using custom javascript:
    var Mask = this.getField("Course").value;
    if(Mask == 'Swimming') this.getField("Code").display = display.visible;
    else this.getField("Code").display = display.hidden;
    Whereas Course is the field that is changing and Code is the one that will show/hide based on content of Course.
    Any help?

    Hi Everyone,
    After doing trials with simple calculations it still wasn't working and so I've figured out what the problem is - the document was being exported but with the data being pre-populated from an SQL database in which during the export it all happens at once, not a chain effect so when the export happens it was filling "Code" before "Course" had any info in it...
    The fix was basically having to create a different field in the SQL source itself for an independent field on the pdf form.

  • 10.1.3--Disable a field according to values of another field.

    Hi,
    I am trying to set a filed on the JSP to be disalbed according to values of another field.
    eg. When the value in "ID" field is NOT 10 or 20, the "Bill" field should be disabled.
    I have tried using only one condition which is when "ID" != 10 or "ID" != 20. They work fine. But when I try to combine two conditions together using "&&" sign, I got a syntax error. The JSP does not display at all. I asked an expert about it, the answer is:
    #{(bindings.Deptno.inputValue.value !=10) &&(bindings.Comm.inputValue.value > 1000)}. I tried this on my application and got the same syntax error.
    Has anybody had a similar situation? Any idea what could be wrong? Thanks in advance.
    Annie

    Hi bsalvador,
    I've had a simular situation once where I needed to make items disabled or required depending on a workflow step and on depending on other page items. Basically the disabling of items is done by javscript, keep in mind that readonly is not the same as disabled. When you use readonly, the item can still be manipulated with javascript. When you disable an item, the item is not even submitted to the database, so you have to make sure that your submit process can hadle that.
    There are two different situations:
    First you have the page load / page submit, there you can use PL/SQL to check which items should be submitted, hand them a javascript class or make them readonly/disabled straight away.
    Second you have a situation where you want to disable certain items depending on the value of other items. This is done 'on the fly' and should be handled with a javascript function.
    Keep in mind however that javascript runs client side and isn't a secure way to handle data integrity, so you would need a database process to validate which items need to be submitted as well.
    Regards,
    Vincent Deelen

  • Field with a default value from another field

    I need to populate a field as the default value from another field that the user inputs. I've tried the scripting that I found from the below Topic in the Archived Forums, but I'm not able to make it work. I've tried numerous variations and still to no avail. I tried to make the scripting work in Acrobat 6 and then decided that maybe I needed to upgrade, so I'm now trying it in Acrobat 8 with no results. Can anyone help?
    Topic
    Acrobat 5 - field with default value of another field
    Ben PF - 03:31am Mar 23, 2007 Pacific
    How can I have a field date2 which has the default value of field date1, but which can be edited by the user if necessary without changing the value of date1.
    I've tried, but I just can't figure it out!
    Any help much appreciated.
    Ben
    | Back to Topic List | Bookmark | Subscribe
    To start a NEW discussion click on the Back to Topic List link and select Add Topic.
    If you are in an archive forum please go up to the main topic list (archives are read only).
    Messages
    2 messages. Displaying 1 through 2.
    First Previous Next Last Show All Messages
    Gene Dianoski - 5:22am Mar 23, 07 PST (#1 of 2)
    This, or some variation of this, should work:
    if(this.getField("date2").value == ""{
    this.getField("date2").value = this.getField("date1).value;
    | Bookmark back to top
    Ben PF - 6:49am Mar 23, 07 PST (#2 of 2)
    Thanks very much.
    I put it in at document level to start, but it didn't run the script automatically when date1 was first filled in, so I have put it in as a mouse exit action in date1 and it works a treat.
    Thanks for your help.
    Ben

    Okay forget what I posted above and lets start over. Go to your first field and under Properties -> Actions Tab -> Select Trigger -> On Blur Run A JavaScript.
    Put this:
    this.getField("myField2").value = event.target.value;
    Make sure that you replace ("myField2") with the actual name of your second field. I just tested this and it works for Acrobat version 6.
    I haven't been doing as much javascripting as I used to, so sometimes I too make some basic mistakes.

  • Automatic population of search help value to another field in module pool

    Hello there,
    I am developing a module pool screen, in which i have a table control field with fields PERNR and ARBPL along with other fields.
    I have to give a search help for Pernr first field for which i have given a search help with the use of PM02 search help, given in the screen field level, in the same search help there is another field ARBPL, when the pernr is selected i have to get the corresponding Arbpl field value in the search help hit list and pass it to my field arbpl in my table control.
    I tried with POV event as well with FM f4if_field_value_request but the return structure always filling one value only PERNR.
    Is there any chance to get the both field values from the search help.
    Thank you in advance.
    Regards,
    Kumar.

    Try the following logic in your table control, in table control you have get the selected index using function DYNP_GET_STEPL.
    TYPE-POOLS: shlp.
    PARAMETERS:p_matnr TYPE marc-matnr,
               p_werks TYPE marc-werks,
               p_ekgrp type marc-ekgrp.
    TYPES:BEGIN OF ty_marc,
          matnr TYPE marc-matnr,
          werks TYPE marc-werks,
          ekgrp TYPE marc-ekgrp,
          END OF ty_marc.
    DATA:i_marc TYPE TABLE OF ty_marc,
         i_val TYPE TABLE OF ddshretval,
         wa_val TYPE ddshretval.
    DATA:wa_dynpfields TYPE dynpread,
        i_dynpfields LIKE STANDARD TABLE OF dynpread.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_matnr.
      SELECT matnr werks ekgrp FROM marc INTO TABLE i_marc UP TO 100 ROWS.
      CHECK i_marc[] IS NOT INITIAL.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield         = 'MATNR'
          value_org        = 'S'
          callback_program = sy-repid
          callback_form    = 'CALLBACK_ROUTINE'
          dynpnr           = sy-dynnr
        TABLES
          value_tab        = i_marc
          return_tab       = i_val
        EXCEPTIONS
          parameter_error  = 1
          no_values_found  = 2
          OTHERS           = 3.
      IF sy-subrc  <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      LOOP AT i_val INTO wa_val.
        IF sy-tabix = 1.
          wa_dynpfields-fieldname    = 'P_MATNR'.
          wa_dynpfields-fieldvalue   = wa_val-fieldval.
        ELSEIF sy-tabix = 2.
          wa_dynpfields-fieldname    = 'P_WERKS'.
          wa_dynpfields-fieldvalue   = wa_val-fieldval.
        ELSEIF sy-tabix = 3.
          wa_dynpfields-fieldname    = 'P_EKGRP'.
          wa_dynpfields-fieldvalue   = wa_val-fieldval.
        ENDIF.
        APPEND wa_dynpfields TO i_dynpfields.
      ENDLOOP.
      CALL FUNCTION 'DYNP_VALUES_UPDATE'
        EXPORTING
          dyname     = sy-repid
          dynumb     = sy-dynnr
        TABLES
          dynpfields = i_dynpfields.
    FORM callback_routine TABLES i_val TYPE ddshreslts
                CHANGING wa_shlp TYPE shlp_descr
                         wa_callcontrol LIKE ddshf4ctrl.
      DATA:
        wa_intf     LIKE LINE OF wa_shlp-interface.
      wa_intf-shlpfield = 'F0002'.
      wa_intf-valfield  = 'X'.
      wa_intf-f4field = 'X'.
      wa_intf-value = '~'.
      APPEND wa_intf TO wa_shlp-interface.
      wa_intf-shlpfield = 'F0003'.
      wa_intf-valfield  = 'X'.
      wa_intf-f4field = 'X'.
      wa_intf-value = '~'.
      APPEND wa_intf TO wa_shlp-interface.
    ENDFORM.                    " CALLBACK_F4

  • How to create a new row for a VO based on values from another VO?

    Hi, experts.
    in jdev 11.1.2.3,
    How to create a new row for VO1 based on values from another VO2 in the same page?
    and in my use case it's preferable to do this from the UI rather than from business logic layer(EO).
    Also I have read Frank Nimphius' following blog,but in his example the source VO and the destination VO are the same.
    How-to declaratively create new table rows based on existing row content (20-NOV-2008)
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/13-create-with-params-169140.pdf
    I have tried:
    1.VO1(id,amount,remark1) and VO2(id,amount,remark2) are based on different EO,but render in same page,
    2.Drag and drop a Createwithparams button for VO1(id,amount,remark),
    3.add: Create insertinside Createwithparams->Nameddata(amount),
    4.set NDName:amount, NDValue:#{bindings.VO2.children.Amount}, NDtype:oracle.jbo.domain.Number.
    On running,when press button Createwithparams, cannot create a new row for VO1, and get error msg:
    <Utils> <buildFacesMessage> ADF: Adding the following JSF error message: For input string: "Amount"
    java.lang.NumberFormatException: For input string: "Amount"
         at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    Can anyone give some suggestions?
    Thanks in advance.
    bao
    Edited by: user6715237 on 2013-4-19 下午9:29

    Hi,CM,
    I'm really very appreciated for your quick reply! You know, today is Saturday, it's not a day for everyone at work.
    My principal requirement is as follows:
    1.select/check some rows from VO2, and for each selection create a new row with some attributes from VO2 as default values for VO1's corresponding attributes, and during this process the user may be cancel/uncheck or redo some of the selections.
    --so it's better to implement it in UI rather than in EO.
    2.it's better to implement this function with declarative way as in Frank Nimphius' blog.
    --little Jave/JS coding, the better. I only have experience in ORACLE FORMS, little experience in JAVA/JS.
    In order to get full information for the requirements of my use case, can take a check at:
    How to set default value for a VO query bind variable in a jspx page?
    (the end half of the thread: I have a more realworld requirement similar to the above requirement is:
    Manage bank transactions for clients. and give invoices to clients according to their transaction records. One invoice can contain one or many transactions records. and one transaction records can be split into many invoices.
    Regards
    bao
    Edited by: user6715237 on 2013-4-19 下午11:18
    JAVE->JAVA

  • Field Read Only based on a value of another field

    Hello,
    In our project we´d like to have Field A made Read Only based on a value of Field B. Otherwise it should be R/W.
    Would this be possible in OnDemand ?
    Txs. a lot for any help.
    Antonio

    If your field is the key field that helps in dynamic layout then this is possible. If not try doing a validation on the field.

  • Entry in fields to make compulsory /Required Entry for QM tab fields in MMR

    Dear Gurus ,
    I need to make some fields as Required Entry in Quality Management tab of Material Master record
    So that the users compulsorily need to fill data before saving the MMR. The fields which I want to
    make compulsory are visible after clicking the "Inspection setup" button in the QM tab , the various
    fields are "post to insp. lot", "inspection with task list" etc. like this about 10 fields ,
    I went in OMS9 , but could not find the field ref. group for table RMQAM  , also could not find these
    fields in OMSR.
    Please guide how to make these fields compulsory. Thanks in advance.

    >
    Anil Shan wrote:
    > Dear Gurus ,
    >
    > I need to make some fields as Required Entry in Quality Management tab of Material Master record
    > So that the users compulsorily need to fill data before saving the MMR. The fields which I want to
    > make compulsory are visible after clicking the "Inspection setup" button in the QM tab , the various
    > fields are "post to insp. lot", "inspection with task list" etc. like this about 10 fields ,
    > I went in OMS9 , but could not find the field ref. group for table RMQAM  , also could not find these
    > fields in OMSR.
    >
    > Please guide how to make these fields compulsory. Thanks in advance.
    I don't think this is possible in standard...since all this fields (ticked or un-ticked) flow from the configuration of Inspection types in QM...you have to see there in QM configuration whether anything is possible...
    Regards,
    Indranil

  • How do I add auto text based on value in numeric field?

    Need help... I'm trying to add auto text to a text field based on a value in a numeric field. I want my text field (summary box) to say "Passed" if the value (score box) is equal to 10 and the field to say "Not Passed" if the value is equal to less than 10. My numeric field is being calculated by selecting drop-down lists.
    Thanks in advance for your help.
    Ed Watson
    Here's a link to the document I created...
    https://files.acrobat.com/?trackingid=KGLIT#folder/c3106c32-2e69-4a5f-8ef2-94d25623dbfb

    I think I figured it out.  I used the following script:
    if(NumericField1.rawValue ==1){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==2){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==3){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==4){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==5){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==6){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==7){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==8){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==9){TextField1.rawValue = "Did Not Pass"}
    if(NumericField1.rawValue ==10){TextField1.rawValue = "Passed"}
    There's probably a cleaner way to do the same thing but at least this works for now.  Hope this helps someone else.

  • Setting the visibility of check box based on values of dropdown field

    Dear Experts,
    I have to set the checkbox visible/hidden based on the values of dropdown field.
    Request you to please provide code example.
    Regards,
    Upendra

    Hi,
    For capturing the selected value from the dropdown (ComboBox in SAPUI5) field use the change event of the combobox UI element. Within this you can get the selected value using the getLiveValue() method of the combobox.
    Then depending on the value you can set the visible boolean property of your checkbox.
    Refer to the link ComboBox for more details.
    Regards,
    Saurabh

Maybe you are looking for