Return the value of a form field to WHERE condition in LOV SQL

I'm an APEX newbie.
I'm developing an APEX app using a form based on a dynamic report. The form opens when I click a record in the report, and uses an Automated Row Fetch process to populate the form with the selected record's values.
I have included a few hidden fields on my form, which I want to act as conditions for the WHERE statements in related list boxes, in order to limit the number of list items. For example, I have a field P4_CONT_DEPT_ID, which contains a department number. I have a list box called P4_DIVISION_NAME, which I want to populate with only the devisions related to the current department #.
Here is my List Of Values definition SQL for P4_DIVISISON_NAME
SELECT CONT_DIVISION_NAME display_value, CONT_DIVISION_ID return_value
FROM CONTACTS_DIVISION
WHERE CONT_DIVISION_ID IN
(select DEPT_DIVISION_XREF.cont_division_id from DEPT_DIVISION_XREF
WHERE DEPT_DIVISION_XREF.cont_dept_id = :P4_CONT_DEPT_ID)
GROUP BY CONT_DIVISION_NAME, CONT_DIVISION_ID
ORDER BY 1
Note that I refer to P4_CONT_DEPT_ID to limit the list. This query is not working. ALL values in the listbox's parent table are returned, not the ones specific to the dept id. If I hard code the dept id, it works fine. What am I missing here?
I should mention that I'm using APEX 3.2. I know that creating dynamic list boxes is not going to be easy, even this first step is giving me fits! But I have to remain on this version. Any help on this would be greatly appreciated.
Thanks!

I figured it out. The bind variable substitution works as designed. It was just my head that wasn't working right.

Similar Messages

  • How to retrieve the procedure value and pass the value to a form field

    How to retrieve the procedure value and pass the value to a form field?

    Set property for the field and the value is the actual procedure/function.
    Cheers

  • Using Auto Suggest To Set The Value Of Multipe Form Fields

    I would like to use the Spry 1.5 Preview Auto Suggest widget
    to provide the value for multiple form fields based on the row the
    user selects in the auto suggestion data set. I've placed an
    example of what I want to do here:
    http://www.brucephillips.name/spry/Spry_P1_5_Preview/autosuggest/autosuggestMultipleFields .cfm
    It appears that when the user clicks on one of the rows in
    the auto suggestion data set, the current row for the data set is
    not updated but remains the default (first row in the data set).
    Therefore, if you have a spry:detailregion that uses that data set,
    the values for that detail region are from the first row in the
    data set and not the row the user selected.
    Is it possible to set the current row of the auto suggest
    data set to the row the user clicked on in the auto suggestion data
    set so that the spry:detailregion will have the values from the row
    the user clicked on?
    I had previously modified the Spry 1.4 Auto Suggest widget to
    do this. See:
    http://www.brucephillips.name/blog/index.cfm/2006/11/6/Modifing-Sprys-Auto-Suggest-Widget- to-Bind-Users-Selection-to-A-Form
    Thank you for any assistance.

    Cristian: thank you for the reply. I understand your concern
    about the user changing the auto suggest field after updating the
    complimentary fields. I think that could be handled through user
    instruction. Additionally, instead of using form fields to hold the
    complimentary data I could use non-editable paragraphs.
    I hope the change is not too difficult. I think this
    modification would make the auto suggest widget even more useful.
    For example think about a product auto suggest. User starts to type
    in the name of the product, selects the full product name from the
    auto suggestions, and now the page can immediately show in a
    spry:detailregion all the product details.
    Thanks again for considering my request. I really appreciate
    all the work the Spry team is doing. I'm looking forward to the
    official release of Spry.

  • How to set the where clause of a value set on the basis of a form field

    I am using a DFF(Descriptive FlexField), which needs to display the value of a certain column(say columnA) on the basis of the value of another column(say columnB).
    So i have created a value set which points to the table which has both these columns, and the DFF uses this value set. However, the problem is that I have not put any where clause in the value set, because of which i cannot handle the exact fetch returns more than one rows error.
    The query has to be as follows:
    select ColumnA from tbl where ColumnB = [ a form value ];
    What I want to know is how can i get the value of a certain field of a certain block of the form in the above query.
    Edited by: 981615 on Jan 14, 2013 12:48 AM
    Edited by: 981615 on Jan 14, 2013 12:48 AM

    Just have a look over these two statements if it solves your problem
    one time where clause
    Set_Block_Property('BLOCK_NAME',ONETIME_WHERE,your form item);
    dynamic where clause
    set_block_property('BLOCK_NAME'default_where, your form itme)
    you can where clause at run time from any procedure or some triggers

  • How to return the values of LOV to items in forms

    Hi,
    I have created an LOV based on a select statment that return 3 columns
    I want to return theses 3 values to 3 items in the form?
    I'll appreciate any suggestion.
    Imad.

    An LOV has only two components: text and value. You can see them in the html page's source. A work around is to use a procedure to query the data and create a cursor, count the # of records in the query. Create a javascript function to create parallel arrays to hold the data on the html page and pass the function parameters via an event on the page. Create the procedure in the db.
    procedure follows...
    CURSOR c_customer
    /* use a cursor to get all the prices */
    IS
    SELECT
    c.customer_number, c.customer_name, NVL(a.address1, 'N/A') ADDRESS1,
    NVL(a.address2, 'N/A') ADDRESS2, NVL(a.city, 'N/A') CITY, NVL(a.state, 'N/A') STATE,
    NVL(a.province, 'N/A') PROVINCE, NVL(a.country, 'N/A') COUNTRY, NVL(a.postal_code, 'N/A') POSTAL_CODE
    FROM table1 b, table2 a, table3 c;
    v_count NUMBER;
    BEGIN
    SELECT COUNT(*)
    INTO v_count
    FROM table1 b, table2 a, table3 c
    where ...;
    /*where clause and table names have been removed, use your's. They should be identical in both queries */
    /* begin your Javascript, substituting values from the
    cursor as necessary into parallel arrays*/
    HTP.p('<script language="JavaScript1.1">');
    HTP.p('<!-- ');
    /* initialize the arrays */
    HTP.p(' var customer_no_arr = new Array('||v_count||'); ');
    HTP.p(' var customer_name_arr = new Array('||v_count||'); ');
    HTP.p(' var address1_arr = new Array('||v_count||'); ');
    HTP.p(' var address2_arr = new Array('||v_count||'); ');
    HTP.p(' var city_arr = new Array('||v_count||'); ');
    HTP.p(' var state_arr = new Array('||v_count||'); ');
    HTP.p(' var province_arr = new Array('||v_count||'); ');
    HTP.p(' var country_arr = new Array('||v_count||'); ');
    HTP.p(' var postal_code_arr = new Array('||v_count||'); ');
    /* populate the arrays */
    FOR r IN c_customer LOOP
    HTP.p ('customer_no_arr['||to_char(c_customer%ROWCOUNT - 1) ||'] = "'||r.customer_number||'";');
    HTP.p('customer_name_arr['||to_char(c_customer%ROWCOUNT - 1)||'] = "'||r.customer_name||'";' );
    HTP.p('address1_arr['||to_char(c_customer%ROWCOUNT - 1)||'] = "'||r.address1||'";' );
    HTP.p('address2_arr['||to_char(c_customer%ROWCOUNT - 1)||'] = "'||r.address2||'";' );
    HTP.p('city_arr['||to_char(c_customer%ROWCOUNT - 1)||'] = "'||r.city||'";' );
    HTP.p('state_arr['||to_char(c_customer%ROWCOUNT - 1)||'] = "'||r.state||'";' );
    HTP.p('province_arr['||to_char(c_customer%ROWCOUNT - 1)||'] = "'||r.province||'";' );
    HTP.p('country_arr['||to_char(c_customer%ROWCOUNT - 1)||'] = "'||r.country||'";' );
    HTP.p('postal_code_arr['||to_char(c_customer%ROWCOUNT - 1)||'] = "'||r.postal_code||'";' );
    END LOOP;
    /* use this variable to determine the size of the array */
    HTP.p ('var num_customers = '||v_count);
    /* create the function--accept a parameter that tells
    you which customer has been selected from the select_co
    combo box */
    HTP.p ('function get_customer (form, field, customer_num)
    var pieces = field.split(".");
    var address1field = new String(pieces[0] + ".MASTER_BLOCK.ADDRESS1.01");
    var address2field = new String(pieces[0] + ".MASTER_BLOCK.ADDRESS2.01");
    var cityfield = new String(pieces[0] + ".MASTER_BLOCK.CITY.01");
    var statefield = new String(pieces[0] + ".MASTER_BLOCK.STATE.01");
    var provincefield = new String(pieces[0] + ".MASTER_BLOCK.PROVINCE.01");
    var countryfield = new String(pieces[0] + ".MASTER_BLOCK.COUNTRY.01");
    var zipcodefield = new String(pieces[0] + ".MASTER_BLOCK.POSTAL_CODE.01");
    /* Get the customer number and pass it to the array to look up the address.*/
    var customer_no = customer_num;
    /* loop through the array until you find the right product ID */
    for (var i=0 ; i < num_customers; i++)
    if (customer_no_arr[i] == customer_no)
    /* return the correct customer information */
    form.elements[eval(address1field)].value = address1_arr;
    form.elements[eval(address2field)].value = address2_arr[i];
    form.elements[eval(cityfield)].value = city_arr[i];
    form.elements[eval(statefield)].value = state_arr[i];
    form.elements[eval(provincefield)].value = province_arr[i];
    form.elements[eval(countryfield)].value = country_arr[i];
    form.elements[eval(zipcodefield)].value = postal_code_arr[i];
    /* close out the Javascript */
    HTP.p ('//-->');
    HTP.p ('</SCRIPT>');
    END gen_customerlookup;
    A specific example is found in the ORACLE Press book by Steve Vandiver & Kelly Cox "ORACLE9i Application Server Portal Handbook" ISBN # 0-07-222249-2 pages 358 - 361. Several lines, and better explaination than room for here.
    get_customer (this.form, this.name, this.value); is placed in the appropriate event. Put "sales.gen_customer_lookup;" in the "before displaying the page" section. sales is the schema where the procedure gen_customer_lookup is created.
    Ken

  • How do I insert the value of an email field in the submit mailto: argument?

    I want to create a button that will redirect a PDF form to an email address entered as a field in the form.  In other words, a "return to sender" function.  The button function has a submit to URL where you can use "mailto:[email protected]".  How can I substitute the value from an email field in the form itself for the "[email protected]" value?

    You'll need to use JavaScript, and the mailDoc method in particular: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.505.html
    Get the value of the field that contains the email address and use it as the value of the cTo property. See the following for a sample script: http://forums.adobe.com/message/3553628?tstart=-1

  • Exchange Mail Store Lookup Reconciliation no longer returns the values

    Hi guys,
    I executed the schedule "Exchange Mail Store Lookup Reconciliation" and returned the value of mail store with sucess. Now I run again but not return the values. The values existed on the Lookup.ExchangeReconciliation.MailStore was cleaned.
    I need this values for provision a user to Exchange. Is it ok?
    Thanks

    I execute the task, is finished with success. But not bringer any values to Lookup.ExchangeReconciliation.MailStore
    [2012-01-11T11:08:39.250-02:00] [oim_server1] [NOTIFICATION] [] [OIMCP.MEXC] [tid: OIMQuartzScheduler_Worker-9] [userId: oiminternal] [ecid: 0000JJCoOzaE^MWFLzyGOA1F3OLz000002,0] [APP: oim#11.1.1.3.0] com.thortech.xl.schedule.tasks.tcExchangeMailStoreLookupReconTask : execute : Starting Exchange Mail Store Lookup Reconciliation Task
    [2012-01-11T11:08:39.255-02:00] [oim_server1] [NOTIFICATION] [] [OIMCP.MEXC] [tid: OIMQuartzScheduler_Worker-9] [userId: oiminternal] [ecid: 0000JJCoOzaE^MWFLzyGOA1F3OLz000002,0] [APP: oim#11.1.1.3.0] com.thortech.xl.schedule.tasks.tcExchangeMailStoreLookupReconTask : isReconStopped : Stopping Reconciliation.....................
    [2012-01-11T11:08:41.924-02:00] [oim_server1] [NOTIFICATION] [] [OIMCP.MEXC] [tid: OIMQuartzScheduler_Worker-9] [userId: oiminternal] [ecid: 0000JJCoOzaE^MWFLzyGOA1F3OLz000002,0] [APP: oim#11.1.1.3.0] com.thortech.xl.schedule.tasks.tcExchangeMailStoreLookupReconTask : execute : Exchange Mail Store Lookup Reconciliation Ends
    For provision a user to Exchange, I need select a "Mail Store" on the form. But if task "Exchange Mail Store Lookup Reconciliation" not bring the values to Lookup, I can not provision a user. I'm correct?
    Because when I try provision a user to Exchange, in the log, show me:
    [2012-01-11T11:05:00.508-02:00] [oim_server1] [ERROR] [] [OIMCP.MEXC] [tid: [ACTIVE].ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: bfccc7416174d6cc:6f5adea4:134ccd17bf0:-8000-000000000000025a,0] [APP: oim#11.1.1.3.0] com.thortech.xl.integration.Exchange.tcExchangeTasks : createMailboxForADUser : Insufficient data, may be all mandatory field are not present : :Index: 0, Size: 0
    [2012-01-11T11:05:00.509-02:00] [oim_server1] [ERROR] [] [OIMCP.MEXC] [tid: [ACTIVE].ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: bfccc7416174d6cc:6f5adea4:134ccd17bf0:-8000-000000000000025a,0] [APP: oim#11.1.1.3.0]
    Thanks a lot

  • Why my JSP page can't get the value of a hidden field

    Hi, I got an interesting question here.
    I use req.getParameter() method to get a hidden field in Servlet, it works just fine.
    However, when I use the JSP to catch the value of that hidden field, JSP just can't, but if I change the type from hidden to text, it works fine again.
    the code is as follows:
    there are two jsp pages:game.jsp and GameMonitor.jsp.
    In game page:
    ============================================================
    <FORM action=GameMonitor.jsp method=post
    webbot-action="--WEBBOT-SELF--">Display the names of all the players currently
    connected to the server       <INPUT tabIndex=1 type=submit value=Lookup name=B1>
    <INPUT TYPE=hidden,value=1 name=p1>
    <P></P></FORM>
    ===========================================================
    I want GameMonitor.jsp to catch the value of hidden field "p1" by calling request.getParameter()
    the code catching it in the GameMonitor.jsp is:
    ============================================================
    String option = request.getParameter("p1");
              out.println("option=["+option+"]");
              try{
                   if(option.equals("1")){
    ===========================================================
    supurisingly, the result is option=[], which means it didn't catch the value of the p1 submitted by POST method.
    Does anybody here can tell what's wrong in the code?

    Thank you so much, I also found this error, which makes JSP not able to catch the hidden field, however, if I change it to text type, even the comma exists, it still works. pretty interesting!
    >
    <INPUT TYPE=hidden,value=1 name=p1>Modify the above lline and write like this....
    <INPUT TYPE="hidden" name="p1" value="1">
    And ensure that you're submitting the form data.
    Though nothing much has been changed, just try whether
    these help!!!
    fun_one

  • I need to get the value of a text field that is located in another page JSP

    I need to get the value of a text field that is located in another page JSP. How do I do that?

    Well you see, I have a page at angelfire.com, which
    does not support JSP. I want to call a script located
    at mycgisever and then, when pressing a link on the
    former page, the JSP page is loaded, and the script
    get the value from the text field on the OTHER page.
    Is this possible?I know nothing about cgi. But that should not prevent me from understanding what can and cannot be done, assuming cgi is sort of comparable with jsps.
    I'm unable to understand your description clearly. Try to explain it better. Give precise steps that you intend to follow and I should be able to help you further.
    So you have a page1.
    You hit submit from page1.
    That goes to the cgiserver.
    From the cgiserver, programmatically load up the jsp.
    search this for the text field.
    Display it on your page2.
    Is that what you are trying to do?
    BTW, won't be able to help you with cgi scripting at all. Can help with Java and Jsp.

  • How do I get the values from a form?

    How do I get the values from a form?

    You can try using request method..
    request.getParameter("yourFormInputName");
    Try this.

  • I am trying to get a hold of the value of a seeded field

    I added a custom region to a seeded page, part of my validation, I should check a value from the seeded page against a value in my region.
    I am trying to get a hold of the value of a seeded field, this is an Oracle selfservice benefits update page.
    The page name is /oracle/apps/ben/selfservice/enrollment/webui/EnrtSelctPG.
    The fields I am looking at are healthplan option name and the selection field-that has the check flag.
    I am unable to find out the name of the fields and unable to figure out how I can get to the two fields to check their values.
    Can someone please assist?
    Thank you,

    I am trying to validate when the user click next.
    Compare values from my custom region and a value in a nested seeded region. This is the first tme I am trying to get a hold of a seeded field on the seeded page.
    I created stand alone region before, but never compared values and validated Oracle seeded fields.So I am not sure how to go about it.
    Thanks,

  • Get the value of a particular field in a segment of an Idoc

    Hi All,
    I have a requirement where I need to write a report which will fetch the value of a particular field in a segment of an idoc.
    I have the idoc number segment and field name as input parameters by which I can fetch Sdata from EDID4 but the confusion is how to find the exact field value from that Sdata. How to Map the SDATA to the segment structure.
    Please advice...

    Hi,
    I have one last doubt that may be you people can help with... The user will be giving the segment name and field name as input. So by following Kesav's code while i can get all the values in the segment structure at runtime please suggest how to display any one field from that structure given that that particular field will come at runtime.
    EX: user gives an idoc number 123 (say belonging to Orders basic type)
                                 segment E1EDK01
                                 field  BELNR.
    So i need to display the value of E1EDK01-BELNR of idoc number 123.
    Please suggest how to achieve this....

  • How to move the value from a character field to numeric or packed decimal

    Hi,
    can anyone explain me on how to move the value from a character field to numeric or packed decimal.
    Please help me on this. Thanks...
    Regards,
    Rose.

    Hi ,
    if you use keyword MOVE u may loose the decimal and thoussan separator and if u don't want to loose them just call the FM ..HRCM_STRING_AMOUNT_CONVERT.
    i doubt wherther it is HRCM or HCRM just try using *
    this will suit ur requirement.
    Regards,
    KK

  • What is the registry key in Adobe Acrobat v9 which turns the dialog off: any form fields that have the same name in the merged documents are now...

    what is the registry key in Adobe Acrobat v9 which turns the dialog off: any form fields that have the same name in the merged documents are now...

    There is no key because that is an important dialog.  Why would you want it to go away?

  • SUBMIT and return the value of that report into internal table

    Dear all,
    I have a requirement. I want to submit a report and return the value of that report into my internal table.
    How to do this.
    Pl. guide.

    Hi Vidhya,
    Below links from SAP help will resolve your issue.
    http://help.sap.com/saphelp_nw04/Helpdata/EN/fc/eb3bde358411d1829f0000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3bd1358411d1829f0000e829fbfe/content.htm
    Edited by: Harsh Bhalla on Jan 2, 2010 11:54 AM

Maybe you are looking for

  • Voice messages not working on iOS8 on iphone 5s

    Hi, I upgraded my ipad mini (1) and my iphone 5S to ios8. All seemed to go fine. My 5S has definitely upgraded... but while I see a microphone to the right of the sendbar on my ipad, I don't see something comparable on my 5S. Is that an iphone 6 only

  • Why can't I write ID3 tags?

    Hi gang. Odd problem. Just very recently noticed it. With some files, but not all, when I go to bounce them, it won't let me write ID3 tags. I click the Bounce icon. The bounce box comes up. I overtype the file name at the top. I select destination M

  • Splitting PCA

    Dear Expert, I am using ECC Version 6.00 I activated FI document splitting based on business area and profit center. I have already done the required customizations. In case I post a document with entering business area and profit center in one line

  • Need help in getting subtotal in ALV

    Hi Experts I've done subtotal in ALV. I'm getting below output. But i want net value subtotal should come by adding to its previous subtotal. Ex :   4969      02.01.1997     CURA         5.500          4970      03.01.1997     CURA        38.338  (32

  • I was trying to turn on my wifi in the iCloud, but the message shows processing and keep waiting for the machine to process but it never turn around. I tried to turn off but can't do it. I turn off

    My iCloud system is dead and does not move at all. It showed loading and there is nothing comming up. I can't log off or do anything. Only an minimise it But it came up again when I turn on my MacBook Air again.  How can I turn off the iCloud again.