Populate field based on selection from another field?

I'm using a Data Connection with a SQL query that returns two fields (StNameFull and ADDRKEY). I have a drop-down list called "Address" with the list items dynamically bound to StNameFull, so the user can select the address.
What I'm trying to do is populate the second field "Key" with the corresponding record, based on the selection made from the drop-down list.
Is it possible to script this so that when the Address is selected the Key will automatically fill in with the key that matches the address selcted?
I currently have "Key" as a text field bound to ADDRKEY, but not sure how to have it check what was selected in "Address"
Thanks so much,
- Kevin

Yes it is possible but you will have to write some script to do it. You wil also have to ge the DataConenction to execute a SQL statement. There is a good blog on this topic at this location:
http://forms.stefcameron.com/2006/09/29/selecting-specific-database-records/
Paul

Similar Messages

  • Populate imagebox based on selection from listbox

    Hi,
    First off, I am not a developer, but I have been able to do quite a few things in Access VBA to suit my needs. 
    I have created an access "application" that lists product information based values entered in a textbox and combobox. Now I need to display the product image as well.
    I have a form with a textbox that the user types in a product brand code. This code determines the styles that are populated in the style combobox (these changes as soon as the brand code changes). I then have a button that runs a query to fetch products
    that have the style and brand as per the previously selected values. I then have a listbox that displays the data from the query. the other fields on the form are populated based on the selection made in the listbox (each time a new row is selected, the details
    on the form change). 
    Up to this point I everything works fine. Now I need to populate an image box based on the selection made on the list. I have a lot of images and they are all named
    brand-style.jpg
    My question is: How do I populate this image box based on the selection made in the list?
    "Of all the things I have lost, I miss my mind the most"

    Store the full path to each image file in a text column in the Products table.  Return this as a hidden column in the list box by setting its column width to zero.  Set the ControlSource property of the image control to reference the list box's
    hidden column.
    You'll find examples of how to load an image into an image control in various contexts as Images.zip in my public databases folder at:
    https://onedrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169
    If you have difficulty opening the link copy its text (NB, not the link location) and paste it into your browser's address bar.
    Ken Sheridan, Stafford, England

  • How to populate a table based on a row selection from another table.

    Hi, i just started to use ADF BC and Faces. Could some one help me or point me a solution on the following scenario .
    By using a search component , a table is being displayed as a search result. If i select any row in the resulted table , i need to populate an another table at the bottom of the same page from another view. These two tables are related by primary key . May i know how to populate a table based on a row selection from another table. Thanks
    ganesh

    I understand your requirement and the tutorial doesn't talk about Association between the views so that you can create a Master-Detail or in DB parlance, a Parent-Child relationship.
    I will assume that we are dealing with two entities here: Department and Employees where a particular Department has many Employees and hence a Parent-Child relationship.
    Firstly, you need to create an Association between the two Entities - Department and Employees. You can do that by right clicking on the model's entity and then associating the two entities with the appropriate key say, DepartmentId.
    Once you have done that, you need to link the two entities in the View section with this Association that you created. Then go to AppModule and make sure that in the Available View Objects: 'EmployeesView' appears under 'DepartmentView' as "EmployeesView via <link you created>". Shuttle the 'DepartmentView' to the right, Data Model and then shuttle
    "EmployeesView via <link you created>" to the right, Data Model under 'DepartmentView'.
    This will then be reflected in your Data Controls. After that, you simply would have to drag this View into your page as a Master-Detail form...and then when you run this page, any row selected in the Master table, would display the data in the Detail table.
    Also, refer to this link: [Master-Detail|http://baigsorcl.blogspot.com/2010/03/creating-master-detail-form-in-adf.html]
    Hope this helps.

  • How to display data from a recordset based on data from another recordset

    How to display data from a recordset based on data from
    another recordset.
    What I would like to do is as follows:
    I have a fantasy hockey league website. For each team I have
    a team page (clubhouse) which is generated using PHP/MySQL. The one
    area I would like to clean up is the displaying of the divisional
    standings on the right side. As of right now, I use a URL variable
    (division = id2) to grab the needed data, which works ok. What I
    want to do is clean up the url abit.
    So far the url is
    clubhouse.php?team=Wings&id=DET&id2=Pacific, in the end all
    I want is clubhouse.php?team=Wings.
    I have a separate table, that has the teams entire
    information (full team name, short team, abbreviation, conference,
    division, etc. so I was thinking if I could somehow do this:
    Recordset Team Info is filtered using URL variable team
    (short team). Based on what team equals, it would then insert this
    variable into the Divisional Standings recordset.
    So example: If I type in clubhouse.php?team=Wings, the Team
    Info recordset would bring up the Pacific division. Then 'Pacific'
    would be inserted into the Divisional Standings recordset to
    display the Pacific Division Standings.
    Basically I want this
    SELECT *
    FROM standings
    WHERE division = <teaminfo.division>
    ORDER BY pts DESC
    Could someone help me, thank you.

    Assuming two tables- teamtable and standings:
    teamtable - which has entire info about the team and has a
    field called
    "div" which has the division name say "pacific" and you want
    to use this
    name to get corresponding details from the other table.
    standings - which has a field called "division" which you
    want to use to
    give the standings
    SELECT * FROM standings AS st, teamtable AS t
    WHERE st.division = t.div
    ORDER BY pts DESC
    Instead of * you could be specific on what fields you want to
    select ..
    something like
    SELECT st.id AS id, st.position AS position, st.teamname AS
    team
    You cannot lose until you give up !!!
    "Leburn98" <[email protected]> wrote in
    message
    news:[email protected]...
    > How to display data from a recordset based on data from
    another recordset.
    >
    > What I would like to do is as follows:
    >
    > I have a fantasy hockey league website. For each team I
    have a team page
    > (clubhouse) which is generated using PHP/MySQL. The one
    area I would like
    > to
    > clean up is the displaying of the divisional standings
    on the right side.
    > As of
    > right now, I use a URL variable (division = id2) to grab
    the needed data,
    > which
    > works ok. What I want to do is clean up the url abit.
    >
    > So far the url is
    clubhouse.php?team=Wings&id=DET&id2=Pacific, in the end
    > all
    > I want is clubhouse.php?team=Wings.
    >
    > I have a separate table, that has the teams entire
    information (full team
    > name, short team, abbreviation, conference, division,
    etc. so I was
    > thinking if
    > I could somehow do this:
    >
    > Recordset Team Info is filtered using URL variable team
    (short team).
    > Based on
    > what team equals, it would then insert this variable
    into the Divisional
    > Standings recordset.
    >
    > So example: If I type in clubhouse.php?team=Wings, the
    Team Info recordset
    > would bring up the Pacific division. Then 'Pacific'
    would be inserted into
    > the
    > Divisional Standings recordset to display the Pacific
    Division Standings.
    >
    > Basically I want this
    >
    > SELECT *
    > FROM standings
    > WHERE division = <teaminfo.division>
    > ORDER BY pts DESC
    >
    > Could someone help me, thank you.
    >

  • 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

  • Can I assign a task based on information from another column?

    For example:
    Let's say I have a column called "Question Type" and this column has multiple checkbox choice, those being:
         Math
         Science
         History
         English
         Other
    I want to allow users to be able to select multpile catagories for the question, like making one both math and science (which right now is completely possible)
    I then want another column that says who the problem is assigned to. Bob is good at math, Joe at science, Jill at histroy, Jenn at English, and Billy handles everything else.
    1) Is there a way that the task can be automatically assigned to my math expert Bob when I specify that the item I am adding is a math problem?
    2) If I make a problem both math and science, can the task be assigned to both Bob and Joe?
    Thanks in advance!

    Hi,
    According to your post, my understanding is that you wanted to assign a task based on information from another column.
    To assign task to multiple users, you need to:
    Create a workflow and add action: Start Approval Process.
    Click these user, select the Group, change One or a time(serial) to
    All at onec(paralle).
    Right click the action, select Properties, click ExpandGroups, change No to
    Yes.
    Then you can assign task to each member of the group.
    I recommend to follow the steps as below to achieve what you want:
    Create a custom list, add columns: Question Type(Choice); Assigned to(Person or Group).
    Create a workflow associated the list.
    Add conditions and action as below:
    Then the task can be automatically assigned to 123 when the item is a math problem.
    In addition, if you make a problem both math and science, the task can be assigned to both 456 and 789.
    You can add other conditions to satisfy all the requirements.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • How do i populate one field based upon a drop down select from another field?

    Here is what I am trying to do:
    Field 1 is a drop down selection list that requires a user to make a mandatory selection which in this case is a list of apartment complexes. What I am trying to accomplish is once that user makes a selection from the drop down list (Field1) that it will populate Field 2 (standard txt) with the corresponding apartment complexes address.
    So I pick Talan Apartments from field 1, it would populate field 2 with Talan Apartments address. I tried messing around with calculation scripts but I'm fighting a loosing battle here. Some help would be greatly appreciated!

    Hi,
    Here is a sample: https://acrobat.com/#d=Hi0ZwVgVB1PWbxc6OJ0z4A where the script in the exit event of the dropdown sets the value of the address object.
    Good luck,
    Niall

  • Field Populates based on Selection in Another Field

    Hi everyone,
    I have created a new position description template using a pdf form. In this form I have various fields. I would like to populate one field based on what I have selected in another field. For example, I have a field called competency. In this field I can select and choose a competency. If I select "Accountability" I would like the description field to say " Accepts personal responsibility for the quality and timeliness of work. Can be relied upon to achieve results with little need for supervision. " alternatively if I select "Compliance" I would like the description field to say "Complies with policies, procedures, workflows and instructions." Can anyone assist me with script or is there another way of making this happen.
    Thanks in advance

    I think this is what you are looking for:
    Make sure that you select "Commit selected value immediately" in the options tab of the drop down menu.
    //Place this script in the custom validation script of the drop down menu
    //Create a text field caleld Text2
    var MySelection = event.value;
    switch (MySelection) {
    case "Accountability":
        this.getField("Text2").value = "Accepts personal responsibility for the quality and timeliness of work. Can be relied upon to achieve results with little need for supervision. ";   
    break;
      case "Compliance":
        this.getField("Text2").value = "Complies with policies, procedures, workflows and instructions.";
        break;
    I hope this helps.

  • Automatically fill input fields based on selection from dynamic drop down

    Hi All,
    I tried to search before posting, but i cannot find appropriate thread (maybe wrong keyword).
    My scenario:
    1. In my offline interactive form, I have:
        a.  Material Number --> drop down field with "Allow Custom Text Entry" ticked
        b.  1 execution button to call web service
        c.  Material Group - Input Field (Read Only)
    2. User will enter material number with wild card character (eg: ABC*).
        User will then click the execution button.
        Web Service in result will return all materials that match the entered material number.
        Dynamic binding will do the magic to generate the drop down list.
    3. Beside material number, web service will also return material description and material group.
        Below is the illustration:
         Material        Description       Material Group
         ABC              Material ABC               GRP01
         ABCDE        Material ABCDE          GRP02
    --- so far so good ---
    My requirement:
    Every time user select material from the drop down list, i want to auto-populate field "Material Group" (which value is also returned by web service).
    I know i need to put the script on event change of the drop down field.
    But i don't know how to read internal table returned by web service.
    Hope someone can enlighten me.
    Thanks in Advance !!!

    Solved after reading:
    1. /people/juergen.hauser2/blog/2007/09/03/accessing-data-nodes-in-sap-interactive-forms
    2. Chapter 7 of Live Cycle Designer Scripting Basics
    (http://help.adobe.com/en_US/livecycle/9.0/LiveCycle_Designer_Scripting_Basics.pdf)
    Thanks.

  • Populate a dropdown based on selected in another dropdown in a seperate table

    Good Day All;
    This may sound like a simple question to most, but… It has had me frustrated trying to figure out.
    I am trying to populate a dropdown based on what is selected in another dropdown.
    Let me explain what I have done so far.
    LifeCycle Designer 8.05.2
    When I had both dropdowns in the same table, I did not have a problem. The code I used is
    Table name is “Table1”
    if(directorate.rawValue == "1")
    division.clearItems();
    division.addItem("select")
    I was asked to move things around and now “division” is located in “Table2”
    I know I need to reference “Table1” but I am running into a Syntax error. I have tried the following code;
    if(Table1 Row1 directorate.rawValue == "1")
    division.clearItems();
    division.addItem("Faire un choix")
    if(Table1.Row1.directorate.rawValue == "1")
    division.clearItems();
    division.addItem("Faire un choix")
    Any help would be appreciated
    Chomp

    You're missing a semicolon at the end of the addItem line, and on the second code sample you've got no periods in the SOM reference (Table1 Row1 directorate). 
    The easiest way to get the path to another field is to ctrl-click on the field while you are in the script editor.

  • Setting current row of a view based on row selected from another view.

    Hi,
    We have two Views V1 and V2. Both views are based on the same tables except that V1 is based on multiple tables. In our application we are showing a read only table which is based on V1. The user can select a particular record for edit. But the edit page is based on V2 and as a result the first record always shows up for editing even though the user may have selected another record.
    Is there a way we can pass the primary key of the record selected from V1 to V2 and set that record as the current record.
    We have tried setCurrentRowWithKey, but this did not help.
    Regards
    RHY

    Hello,
    post the PK as an URL parameter within the link you open the edit page. Then read this parameter in your page (the page with this link) action class and send it to an ActionBinding:
    JUCtrlActionBinding action = (JUCtrlActionBinding) bc.findCtrlBinding("nameOfBinding");
    ArrayList arrayList= new ArrayList();
    arrayList.add(0,primaryKey);
    action.setParams(arrayList);
    action.doIt();
    In your AppModule create a method nameOfBinding with primaryKey as in parameter
    public void nameOfBinding (Number primaryKey )
    getV2().setWhereClause("PRIMARY_KEY=:0");
    getV2().setWhereClauseParam(0,primaryKey );
    getV2().executeQuery();
    In the AppModule you have to publish this method in "ClientInterface".
    Create an Action binding for this method in your list jsp.
    Hope this helps
    Britta

  • Is there a way to fill a cell with a value based on the selection from another cell?

    For example: If have a drop down menu created for Cell A1 with options (Dog 1, Cat 2, Bird 3). Is there a way to fill cell A2 automatically when I select from the drop down menu.
    So if I selected 'Cat' in A1, cell A2 would automatically input the 2.

    I suggest an extensible method that allows you to add other animals:
    This method adds a small table called "Animal Lookup" that matches names (same as in the pop-up menu) with a value.
    The table on the left uses this table to retrieve the value based on the animal:
    B2=VLOOKUP(A2, Animal Lookup :: A:B, 2, 0)
    select B2 and fill down

  • Polulate textfield(s) from a MS SQL Database based on selection from DropDown List

    I am new to LiveCycle Designer. I am trying to create a Master Bill of Lading form. I want the user to be able to enter a Store Number from a in a text field and, based on what they enter I want to populate the address information from a database on my SQL Server.
    When I bind the address fields from the database, I only see the first record in the database.
    I'm not sure where to go from here...
    Thanks in advance,
    Jeremy

    That seemed to fix my error and returned the value to my DDL.
    I have modified the code so it looks at the clone of my dataConnection (dcStoreData)
    CODE:
    btnClear.MainPage.sStNo::change - (JavaScript, client)
    var inStrNbr = xfa.event.newText;
    if (inStrNbr == ""){
    app.alert("You must enter a valid name - try again!") } var nIndex = 0;
    while(xfa.sourceSet.nodes.item(nIndex).name != "dcStoreData")
    nIndex++;
    tfStoreID.rawValue = inStrNbr;
    var oDB = xfa.sourceSet.nodes.item(nIndex).clone(1);
    // the node pertaining to the data connection specified
    //app.alert(oDB.saveXML("pretty"));
    //set up sql call to DB to get specifics about employee
    oDB.nodes.item(1).query.setAttribute("text", "commandType");
    oDB.nodes.item(1).query.select.nodes.item(0).value = "Select * from tblStoreMast_LastVersion where StorNbr = '" + inStrNbr + "'";
    //app.alert(oDB.nodes.item(1).saveXML("pretty"));
    //now connect to DB and get a record
    oDB.open()
    oDB.close();
    it runs with no error and I am seeing the value it has given my DDL.rawValue
    Now I get the "error:"
    GeneralError: Operation failed.
    XFAObject.open:16:XFA:btnClear[0]:MainPage[0]:sStNo[0]:change
    ado2xfa operation failed.  Item cannot be found in the collection corresponding to the requested name or ordinal.
    My Store Number is stored as an int in the database.
    Do I have to somehow cast it as a character?
    Sorry for the headache!
    Jeremy

  • Problem in popultating combobox based on input from another combobox

    i have there combo boxes when i select the first combobox ,based on the input given it must populate the second and based on the input in second combo box it must populate the third one.1->2->3.
    Actually i am having a javascript when i select the data in first combo box the information is sent to specified jsp page with parameter using onchange function and the second combo box is poplated based on the first but the third combo box in not populating based on the second.
    here is my code:
    jsp:
    <select name="recrClient" class="selectBox" id="recrClient" onchange="htmlData('BSTSRecuritmentContacts.jsp', 'client='+this.value);">
    javascript
    function stateChanged()
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
    document.getElementById("contacts").innerHTML= xmlHttp.responseText;
    else
    //alert(xmlHttp.status);
    // Will populate data based on input
    function htmlData(url, qStr)
    if (url.length==0)
    document.getElementById("contacts").innerHTML="";
    return;
    xmlHttp=GetXmlHttpObject()
    if (xmlHttp==null)
    alert ("Browser does not support HTTP Request");
    return;
    if (url=="BSTSRecuritmentContacts.jsp")
    url=url+"?"+qStr;
    url=url+"&sid="+Math.random();
    xmlHttp.onreadystatechange=stateChanged;
    xmlHttp.open("GET",url,true) ;
    xmlHttp.send(null);
    if i use the same method populating the third combo box, this is not working
    please reply me and thanks in advance

    Hi there,
    What about this:
    Create a multicube with 0PA_C01 and 0PE_C01 and then you create one key figure with the total of employes (that comes from 0PA_C01) and another key figure with the total number of employes that had training (that comes from 0PE_C01) and finally you create a calculated key figure at query level that subtracts the first key figure by the second, i.e., the total number of employees - the employees that had training.
    Diogo.

  • Refreshing sql report region based on values from another region - 4.0

    Greetings All,
    I have a page with two regions, say region 1 and region 2. I have a before header process that fetches values from db based on criteria entered from another page. Region 2 is a sql report region with bind variables from region 1. When this page is rendered region 1 renders properly however sql report region always returns no records. What am i missing here?
    I would like to have the region 2 render a report based on the values from region 1. Region 2 has a sql query that looks something like
    select
    colum 1,
    column 2,
    column 3
    from table t1
    where t1.c1 = :p10_item1
    and t1.c2 = :p10_item2Using apex 4.0
    thanks
    Seetharaman

    If these items hidden, try making them display only .
    Also what happens when you move the items from region 1 to region 2.
    From my experience items do not have much of a dependency on the region they are attached to other than cases when the region is not rendered(when its condition fails) and then the item values become null(bcoz they themselves are not rendered).

Maybe you are looking for