Make one field required based on another field

I am trying to set a form up, so that when a check box is marked, then the corresponding date field is required.  I set the script language to Javascript and entered this script: 
if 
(this.rawValue == "1") (PROPOSALDATE.mandatory = "error")
However, I get an error message stating "syntax error near toekn '!' on line 1, column 20."  There is no ! in this script, so I don't know what it is talking about.  What am I doing wrong?

Hi,
The script that executes if the statement is true should be inside curly brackets. So the following in the click event of the checkbox should work:
if (this.rawValue == "1")
     PROPOSALDATE.mandatory = "error";
else
     PROPOSALDATE.mandatory = "disabled";
The above is Javascript.
Hope that helps,
Niall
Assure Dynamics

Similar Messages

  • Make one field mandatory in material master

    hello
    i have searched through the forums but not able to get the right answer.
    i need to make one field MARC-MMSTA mandatory. It lies in field selection group 51.
    There are other fields in this field selection group.
    Hence what happens is when we make the group mandatory all the fields become manadatory.
    Any thoughts please ?
    Thank you.
    Regards
    KK

    Hi,
    In t-code OMSR create the new selection group(Between 221 to 240) ie., select the field MARC-MMSTA assgin new selection group .Then goto OMS9 enter selection group make option as per your requirement.
    Let me know any issue.
    Regards,
    Vairavan.P

  • How to make Multi Select Picklist Field Required Based on another field

    Hi,
    I want to make one filed which is Multi select Required(mandatory) based on certain value in another filed.
    I tried putting IIf([<FieldNAme>]> 1000 AND [<FiledNAme1>] IS NULL,"Invalid",[<FieldNAme>]) in the Field validatation as but it is not working.
    Please suggest any workaround available.
    Warm Regards
    Pramod
    Edited by: user11361975 on Jun 3, 2011 5:03 AM

    I guess FieldName1 is the multiselect picklist you are referring to?
    Where did you get the ITAG from? I don't see any multiselect picklists available in Expression Builder. I doubt whether you can set validations on multi select picklists at all.
    If anyone has achieved this please let me know as well.
    Regards,
    Udaya

  • Simple Question....How do I make one field = another...

    I need Total Labor and Amount Total to populate the same.

    You use the calculation tab. For the "Field is the ____ of fields:" use "Sum" and select the one field. For "Simplified Field Notation" use the field name if it has no special characters. For the "Custom JavaScript calculation"  "event.value = this.getField("My Field Name").value;"

  • How to make one field dependent on another

    Hi All,
    I have 2 fields say FieldA and FieldB which is dependent on FieldA.
    The logic is If FieldA is NULL then FieldB should be NULL
    If FieldA is not NULL then FieldB should be not NULL.
    I have written the following code in the WHEN-VALIDATE-ITEM trigger of FieldA
    if :BLOCK_NAME.FieldA is not null then
    set_item_property('BLOCK_NAME.FieldB', REQUIRED, PROPERTY_TRUE);
    end if;
    This makes the FieldB mandatory (color changes to yellow) when I tab out of FieldA, but if I save the record without any value for FieldB, it gets saved without any errors.
    Any help is appreciated.
    EBS version 12.1.3 DB version 11.2.0.2 and Forms10g

    sreedevi  wrote:
    Hi All,
    I have 2 fields say FieldA and FieldB which is dependent on FieldA.
    The logic is If FieldA is NULL then FieldB should be NULL
    If FieldA is not NULL then FieldB should be not NULL.
    I have written the following code in the WHEN-VALIDATE-ITEM trigger of FieldA
    if :BLOCK_NAME.FieldA is not null then
    set_item_property('BLOCK_NAME.FieldB', REQUIRED, PROPERTY_TRUE);
    end if;
    This makes the FieldB mandatory (color changes to yellow) when I tab out of FieldA, but if I save the record without any value for FieldB, it gets saved without any errors.
    Any help is appreciated.your code is ok for the setting required but if cursor didn't move to FieldB, it will not say anything.
    You can try this...
    change form property
    Defer Required Enforcement=YesHope it will enforce form to enter FieldB.
    Can do another thing, Create form level trigger Pre-Commit and write down code for checking value of FieldA and FieldB and raise form trigger failure.
    Hope this helps

  • How can I make one entity attribute change trigger another's default value?

    Guys and Gals,
    Using JDev 11.1.2.1.0
    I have an order form which has a LOV (Customers) and an address field. The address field should contain the default address associated with the selected key in the LOV.
    To do this, I have an entity (Order) with two attributes (CustomerID & Address). Address has its default value set to "adf.object.getDefaultAddress" which returns the default address for the CustomerID. This only works on initial load.
    How would I make this adf.object.getDefaultAddress trigger when I select a different LOV CustomerID in the View Object?
    I've tried various things but am a little confused. Is there something akin to partial triggers for entity objects?
    I can provide pictures, code, etc.
    Thanks,
    Will

    you can try this.
    go the the setter method in your EntityImpl class for the LOV attribute
    public void setCustomerID(Number value) {
            setAttributeInternal(CustomerID, value);
            //here call the setAddress() method
        }in your page, set the customerID autosubmit to true and make the Address field PPR the customer Id.
    <af:selectOneChoice value="#{bindings.CustomerID.inputValue}"
                               id="soc1"
                               autoSubmit="true">
            </af:selectOneChoice>
            <af:inputText value="#{bindings.Address.inputValue}"
                                   partialTriggers="soc1">
            </af:inputText>

  • Disaggreation of one data set based on another data set

    Hi All,
    We are using Hierarchy based IP implementation using disaggregation option in the input ready query definition.
    We have a requirement as follows:
    1. Disaggregate version 200 based on Version 100.
    So, we have defined an input ready query, which would contain two columns one with the restriction tor the version 200 and one with restriction on version 100. We have hidden the column with restriction on version 100.
    Now, in the disaggregation properties of the column with restriction on version 200, we have turned on the disaggreation with reference to the column with restriction on version 100.
    When the query executed, it is doing always the equal distribution of the toal entered rather than doing the distribution as per the reference column.
    We can do work around using Distribution by reference, but not sure, whether the function can handle hierarchies. Best is to solve by the Input Ready Query disaggregation settings.
    Please let us know if you have any idea on how you have solved this issue, or is this a bug? I will openup a message with SAP after today.
    Thanks in advance,
    Best Regards,
    - Shashi

    Hi Shashi ,
    I have used this disaggregate property available in the query. It is working fine. In my case i am not hiding the reference key nor the dependent characteristics, so it is not giving any problem.
    There might be some problem in distribution if your reference data has some particular combinations of characteristics and in the planning layout you are trying to hide some of the characteristics that are present in your refernce data.
    Please check.
    For more details check this link:
    http://help.sap.com/saphelp_nw70/helpdata/en/43/0c033316cd2bc4e10000000a114cbd/frameset.htm
    You can also try the planning function Distribution by reference, I am not sure whether it will work for hierarchy or not but you can give it a try.

  • In AP3 How To Make One Area Same Color As Another?

    Sorry for dumb newbie question but I am not familiar with AP3 editing tools yet....just loaded it last night.
    How do I set a color reference point on the photo (source color) and then apply that same color selectively to another area of the photo?
    thanx

    I don't know if copying a part of a photo to another part of the photo is what you are looking for.
    But have you tried the Clone brush?
    Just press X to call the Repair/Clone brush dialog, select "Clone" at the top of the dialog.
    Move your brush over the source part of the picture and Alt-click there.
    Then move the mouse to the target position in the pick and begin brushing.
    This copies the contents of the source area to the target area. Try varying the sliders in the dialog to adapt the brush to your needs.

  • How to make one edge server can connect another one

    hello everyone
    there is a problem with mutilple edge server connection.
    i can connect the orgin server with such
    URI:"rtmp://edge1/?rtmp://orgin/app"
    however,the connection has been rejected when i try to use 2
    edge servers before orgin server.and the URI like
    this:"rtmp://edge0/?rtmp://edge1/?rtmp://orgin/app"
    anybody know why that and how to solove?thank you!
    and this is my client code to check the conneciton status
    var server="rtmp://edge0/?rtmp://edge1/?rtmp://orgin/app"
    var nc=new NetConnection()
    nc.onStatus=function(info)
    trace(info.code)
    nc.connect(server);

    Double click the layer icon in the layers panel. Then hit the create mask button at the bottom of the panel (lower red circle). Then with the layer mask selected (upper red circle, notice the black outline shwoing you are working the mask, not the layer), use the gradient tool to make a gradient as shown in the icon preview. Then save for web as PNG24.
    <br />
    <br />
    <a href="http://www.pixentral.com/show.php?picture=1pTgqlM1shye4AuiOINeT6f1833CF0" /></a>
    <img alt="Picture hosted by Pixentral" src="http://www.pixentral.com/hosted/1pTgqlM1shye4AuiOINeT6f1833CF0_thumb.gif" border="0" />

  • How to load one filter values based on another filter selection

    Hi,
    I have a Query/Report that contains the following filters
    Product Family
    Product Line
    Product
    all the above InfoObjects are independent, now i need a functionality where in if i select a Product Family then all the Product Line belonging to that Product Family should get loaded in the filter selection, same way when a Product Line is selected the all the Products under that Product Line should get loaded ni Products filter.
    Please let me know how this functionality can be achived.
    Thanks
    Akila. R

    Hi Akila,
    I am assuming you query runs on a cube that loads data from the source system. In that case cube will contain only valid cobminations of Product Family & Product Line.
    In order to make sure that if a cetain Product Family is chosen you want to see only the relevant Product Line as available in the cube do the following:
    Go to Query Designer Filter
    Pick Product Family > Properties> Advanced. Under the Tab Filter Value Selection during Query Execution choose 'Only Values in InfoProvider'
    Do the same setting for Product Line as well.
    Hope this helps.
    Regards,
    Amrita
    Edited by: Amrita Goswami on Jun 23, 2009 7:26 AM

  • How to make a field un editable in one screen

    Dear Experts,
    I want to know how to make one field as un editable in one screen.I will explain in detail. I want to make "Reconciliation account" field as un editable in XD02 t-code.
    Regards,
    Surendra babu.

    Hi Surendra,
    Use this path in spro:
    Financial Accounting-> A/P&A/R-> CustomerAccounts->MasterData->Preparatons for CreatingCustomerMasterData
    use the transactions & u can update for creation of customer master or hange of customer master.
    Hope this helps you
    Award points if helpful
    chaitanya

  • How to make a one field form with Adobe Muse?

    Hello,
    I hope you can help me guys, im trying to make one field form for a webpage (this form is just to input a phone number, similar as the newsletter sign up forms with one field) and the problem is with the widgets i can´t erase the Name and email field... Is possible to eliminate those?
    thanks a lot for your help

    Hi
    I am afraid its not possible to do the same, as Name and email field are mandatory.

  • 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

  • How do I validate one field's length based on another field's selection?

    I am creating a form for our offices where I need to check one field for length of a serial number based on the answer to a previous field's selection.  Depending on the product selection, the serial number has two different lengths.  Both fields are marked as required, but I want to make sure that we receive the full serial number for our product.  Previous forms were done on paper and instructions were for the last 4 digits only which now we want the full serial number.  One product has a 12 digit number and the other is 6.
    I'm guessing that I need a validation script in the serial number field, but I am not a JavaScript coder and haven't found the right thing when searching.  Any help would be great!
    Thanks!

    Never trust your users to follow what you expect them to do... That often leads to mistakes and problems later on.
    I would reset the s/n field when a selection is made in the drop-down. To do so set the drop-down field to commit the selected value immediately and add code as its custom validation script:
    this.getField("Serial Number").value = "";
    To validate the s/n field you can use something like this as that field's custom validation script (of course, you'll need to adjust the field names and values to match the actual ones in your file):
    event.rc = true;
    if (event.value) {
         var selection = this.getField("Dropdown1").valueAsString;
         if (selection=="1" && event.value.length!=6) {
              app.alert("Error! The s/n must be 6 digits long.");
              event.rc = false;
         if (selection=="2" && event.value.length!=12) {
              app.alert("Error! The s/n must be 12 digits long.");
              event.rc = false;

  • Table Control: make a field editable or not based on another field value

    HI All,
    How to make a column field input enabled or disabled based on another field value in a Table Control.
    Here's the scenario:
    I have a table control with two columns, KTOKK and LIFNR. Now for certain KTOKK, the LIFNR field should be editable and for certain KTOKK it should not be editable.
    Eg.,  KTOKK = 0001 =>  LIFNR field is not editable.
            KTOKK = ZKTO => LIFNR field is editable.
    But these fields are in a table control.
    Please advice.
    Thanks in advance,
    RK.

    Hi RK,
    Go through the below link..
    how to make special field editable or diseditable in table control?
    the code mentioned in the link.. just add ur conditions in the module....
    Best Regards,
    Brijesh

Maybe you are looking for