Fields on single-row Form based on Query

We are implementing a front-end for Oracle Reports using HTMLDB. We have all of our reports and their parameters set up in tables, along with the specification for where to obtain the values to display for the parameters. The tables also specify the display order for the params.
In HTMLDB we need to have the "parameter screen" display when the user selects a report from the tree based on report_id. I created a report based on a query referencing the :p_rpt_id from the tree which lists the parameters for the selected report.
So far no problem. Now, then next step is to implement conditional lists of values on the parameters based on the definitions in the parameters tables.
Some parameters have an unconditional source for values, some have onchange requirement (ie, when you pick a region in p_region the values available in p_customer would include only those in p_region). Each parameter in our table also includes an attribute to specify the type of htmldb_item to render (select list, popup, checkbox etc).
I can get the parameter "report" setup to render the lov's based on the correct sources, but I cannot see where to incorporate the onchange trigger for the "parent" parameters (p_region in the example), or how to get the value from p_region when rendering the lov for p_customer.
Any tips on how to get around this problem?

I think I've managed to work thru the previously stated issues except for one remaining stumbling block:
Test Case:
Report ID: 36
Parameters:
1 Year FISCAL_YR_V
2 Month/Qtr MTH_QTR_V
3 Month FISCAL_MONTH_V
4 Chain ADDR_CHAIN_V
etc.
Params 1,2,4 are generated with htmldb_item.select_list_from_query and htmldb_item.popup_from_query depending on the LOV type specified for the parameter.
Param 3 is also generated by htmldb_item.select_list_from query but its query parameter includes a WHERE clause referencing the value set by param 2 when the onchange event fired.
The problem is the generated lov for param 3 returns no values. Depending on the selection of param 2 (M or Q) the values for param 3 would be 1-12 or 1-4 (respectively). I've tried both of the following in the query for the dependent lov:
where reference_id = :P10_F02
where reference_id = v('P10_F02')
Neither returns any values. I've verified that the correct value for param 2 (M or Q) is being set in the session state by the onchange event on that parameter.
Is there something I'm not setting to cause the query for the dependent lov to bind the new value of P10_F02 when the onchange event fires?

Similar Messages

  • How to query on a single row form using only one page

    Hi APEX experts, I am just a beginner in apex and I face several problems on development. Despite that the forum helps me a lot and your answers to other people are valuable , I have stacked into something. Could you please someone tell me : if there is a way to define a single row form page based on table in which I could query and update without using a tabular page (to call the single row form). I want only to use only one page. Does APEX has this functionality? Thank you very much?

    I haven't tried it, but I am going to guess that yes it's possible (or if I were going to do this, this is what I'd try and I suspect it will work).
    If you take a moment and step back and look at what the wizard does when building a "form on a table with report", all it does is build two pages with page 1 (report overview with drill-down Edit button or link usually) calling page 2 (form) and setting the PK field on the page 2 form with an automated row fetch process and built-in DML processes. It's not that hard.
    Page 2 really doesn't care what the calling page was in order to query a single row; it just cares that ANY caller sets the primary key value for the ARF process to fetch a row. So I would just make page 2 call itself. This is what I'd do (and you might have to fine-tune little things that I might not have forseen but I think this will work).
    For the sake of example, let's say our table is PARTS and in it is a PART_ID, PART_NUMBER, PART_DESCRIPTION, PART_COST, etc. Assume PART_ID is the primary key and sequentially assigned by the DB in a trigger and is functionally meaningless to the user and is for PK purposes only. Let's assume PART_NUMBER is a unique key (although not the PK) by which the user will "know" a unique row (since the PK of PART_ID is more internal and not meaningful to the user). Assume PART_DESCRIPTION, PART_COST, etc. are just attributes.
    1. Use the wizard and build a "form on a table with report". This is just to get the handy dandy ARF process and DML processes, validations, etc. all generated for you. Let's assume the report page is Page 1 and the form is Page 2.
    2. When done, delete the report page entirely (so delete page 1).
    3. Edit the form page (page 2) and change any branch references from the nonexistent page 1 to now be page 2.
    Now here's the part where something has to set the internal P2_PART_ID field when page 2 is run. So why not set it from itself from something the user will uniquely enter?
    4. Create a P2_PART_NUMBER_FETCH item (text item is fine or if you want a LOV or whatever that's good too....whatever works. For clarity, you might even want to create a separate "search" or "query" region separate and above your existing form region to set this field apart visually so users know it's a search field. Source for this field should be "only when current value in session state is null".
    5. Created some sort of "GO" button to go along with the P2_PART_NUMBER_FETCH field.
    6. Make sure none of your existing post-submit processes fire when GO is pressed (edit all of the computations and validations and processes and ensure that they have conditions such that they do not fire when the submit value is "GO", so like a PL/SQL expression and set to v('REQUEST')<> 'GO').
    7. Add a new validation to your page that only fires when GO is pressed. Have it validate only when GO is pressed. Have it validate that P2_PART_NUMBER_FETCH is not null.
    8. Add a new PL/SQL process to your post-submit processing that only fires when GO is pressed. Have it look up to the database based on P2_PART_NUMBER_FETCH and get the PART_ID that corresponds to the part number the user entered and set the part number, something like this (even better for style and reusability if you embed this in a DB package function and call it):
    SELECT part_id
    INTO :P2_PART_ID
    FROM PARTS
    WHERE PART_NUMBER = :P2_PART_NUMBER_FETCH;
    9. Not sure if the branches that were generated will suffice for this (might need to add a new one...review what you have and see) but the bottom line is that the page should branch to itself (page 2) and not clear the cache.
    10. When the page repaints, since :P2_PART_ID is now populated in session state (again, page 2 should not care how it got populated...only should care that it did get populated by anything (including itself)), the automated row fetch (ARF) should fire and query up the row from the database for editing.

  • How to make fields readonly in Interactive Form based on Roles

    Hello All,
    I want to make few fields readonly and also want to disable few fields from the Interactive form based on the role, logged in by user.
    Looking  for a code Snippet on this issue.
    Need help in this Regard.
    Thanks & regards,
    Debasish

    Is the URL you are trying to call a schema.procedure ?
    If so, you need to grant execute privilege on the procedure to the <portal-schema>_public database user.                                                                                                                                                                                                                                                                                                                               

  • Add a form (based on query) to a form (based on table)

    I have a normal form based on a table. I want to put in a little form in a region of this first form that is based on a query. They have one field in common.
    How can I do this?
    Elsie

    Hi Elsie,
    Effectively, you want to end up with a single form and save the data back into two or more tables?
    If so, you could base the entire form on a SQL view and use an INSTEAD OF trigger to update the underlying tables.
    Regards
    Andy

  • Forms based on query?  Is it possible in Oracle Portal?

    here is my code that i want to use
    SELECT a.first, a.last, b.Position_CD, c.skill_cd, d.team_name, d.team_country, d.club, e.structure_name
    FROM Roster a, Roster_position b, roster_skill c, team d, team_structure e
    where (a.Roster_ID = b.roster_id (+) and (b.roster_id = c.roster_id (+) ) and (a.team_cd = d.team_cd(+)) and (a.team_structure_cd = e.team_structure_cd (+)))
    order by a.roster_id;
    Is it possible for oracle portal to support such a query in a form?
    Oracle portal supports single tables or views...master-detal...and forms based on procedures.
    Since the above query associates with moro then one table..how might one create a form based on that query? Is their a way in oracle portal to create a form and have its record source be based on such a complex query and be able to update and insert data? I know and have tested that it works in Ms Access and i can update and add data in that above query. Hopefully oracle supports this. (*cross fingers*)
    If i cant do what i said above...what advice or suggestions you guys have for me? If i use master-detail it won't work right because i need to involve all 5 tables.
    Any help or comments are greatly appreciated!

    When i made the above query a view and created an oracle portal form. I get this error when I try to retrieve all the records in that view i made above.
    An unexpected error occurred: ORA-01445: cannot select ROWID from a join view without a key-preserved table (WWV-16016)
    What does the "key-preserved table" mean?

  • Can I auto-populate fields in a pdf form based on responses in other fields (using Acrobat XI PRO)?

    I am creating a fillable pdf form using Acrobat XI Pro and would like to be able to auto-populate text fields in one section of the form based on responses entered by respondents in an earlier section.  Is this possible?  If so, would it function for respondents using Adobe Reader to complete the form?
    Many thanks,
    Andy

    Thanks, George!  In the form I am creating, I ask respondents to identify a number of organizations that they work with.  For example, I ask "Please list up to ten organizations" and then I provide ten text boxes for organizations 1-10.  I then ask a series of follow up questions (radio buttons, check boxes, and rating scales) about each organization.  I would like to auto-populate the fields of those follow up questions with the names of the organizations that the respondents had written.  Does that make sense?  Will this require JavaScript?  My hope is to avoid complicated scripts that may give respondents technical problems with the form.  Thanks again,
    Andy

  • How to autopopulate fields in a portal form based on database procedure?

    Dear gurus, I am a newbie to the portal world and i have a rather unique problem. I have searched online but still cant find a solution to my problem. I have a portal form (AS version 10.1.4) based on a db procedure that accepts only one parameter. The form has about 12 fields, two of which are combo boxes. Because of the relationship b/n combo box 1 and combo box 2 and the rest of the form fields, the user has to start out by selecting a value in combo box 1. This auto populates combo box 2 (based on the previous selection). However, when the user selects a value from the populated combo box 2, this is supposed to trigger an action to query the database and retrieve values for the remainder of the form fields and populate them accordingly.
    I tried to use p_session.get and set values but discovered that one cannot do this with form fields that are based on a procedure. I could write javascript to call a database procedure but i am not sure how to pass the return values from the database back to the javascript routine and then populate the remaining fields accordingly.
    HELP ME PLEASE!!!
    Thanks

    Hi Venkat, create a section (section control) for each set of columns you want to hide/reveal. Put your columns in that section. Then set a rule on the dropdown so that if dropdown = "this" then show "this" section.
    cameron rautmann

  • Master Detail Form - How 2 update a field in the Detail form using a query?

    Hello,
    I have a master detail form with, each master record having a fixed(6) number of detail records. One of the fields in the detail record is the PART_DESCRIPTION field. I am trying to update this field by querying Table_X. TABLE_X is in the format of (desciption id, description). Description id runs from 1 to 6.
    When the form displays, the PART_DESCRIPTION field for the 6 detail records needs to be automatically populated with the six values of description stored in Table_X. How can this be done?
    Tried using session storage objects, but made no headway.
    Would greatly appreciate pointers on how to go about doing this.
    Thanks.
    Dev

    If you are on a Portal Version lesser than 3.0.9.8.3, then please try the following to populate
    the PART_DESCRIPTION field.
    Steps:-
    1> Edit the form and go to the Additional PL/SQl section and put the following code in the
    "...after displaying the page area" :-
    declare
    type t_vc_arr is table of varchar2(4000) index by binary_integer;
    l_arr_desc t_vc_arr;
    l_form_name varchar2(200);
    l_form_state varchar2(500);
    begin
    l_form_name := p_session.get_module().get_name();
    l_form_state := p_session.get_value_as_varchar2(
    p_block_name => 'MASTER_BLOCK',
    p_attribute_name => '_FORM_STATE'
    if l_form_state = 'QUERY_AND_SAVE' then
    select description
    bulk collect into l_arr_desc
    from <schema>.table_x;
    htp.p('
    <script>
    var descArr = new Array();
    var Fidx = 1;
    var formObj = document.WWVM'||p_session.get_id()||';
    var fieldName = "'||l_form_name||'.DETAIL_BLOCK.PART_DESCRIPTION.0";
    for i in 1..l_arr_desc.count loop
    htp.p('descArr['||to_char(i-1)||']="'||l_arr_desc(i)||'";');
    end loop;
    htp.p('
    for (var i=0; i < formObj.length; i++){
    if (formObj.elements.name == fieldName+Fidx){
    formObj.elements[i].value = descArr[Fidx-1];
    ++Fidx;
    htp.p('</script>');
    end if;
    end;

  • How to change the fields in a JSF form based on a URL parameter

    I am trying to build a generic JSF form of parameters which I want to dynamically change (i.e.
    change which field is visible, what the label text should be, etc) based on a URL parameter.
    I can set the fields using logic in the backing bean as an action on a command button pressed.
    But how do I do it based on the URL parameter ? I can retrieve the URL parameter but I
    don't know where to put (or hook) the Java code to do this initialization prior to
    the page being rendered for the first time.
    The fields in the JSF is being configured dynamically using a database table.
    BTW I am using Jdeveloper 10.1.3.5
    Thanks
    CK

    Thanks. I decided to set a Session bean to store the value of the URL parameter (if it is set)
    and then to use the session bean to initialize the attributes of the fields on the JSF Page.
    There also seems to be some caching of the inputText fields (i.e. it reverts back to the first
    initialized value) even though I tried to change it using the URL parameter in the requestScope
    backing bean. So, setting the values into the Session bean and retrieving it back from there
    seems to be more reliable.

  • How to populate a field in an Infopath form based on the people picker input - only OOTB approach

    Hello,
    I have 3 lists : Resource , Project, Contract
    In "Contract" list i have created a form with MS Infopath 2010. This form is used to collect data of a new resource joining a project . This form also takes the information about the resource's costs.
    Scenario :
    Project informations are already present in the "Project" list.
    Any new resource who will be joining a project will be added in the "Resource" list at first . This list has its own form to do so. While adding this resource the form asks for the project which should be assigned. This is dealt with.
    "Contract" list : In this lists form their is a people picker field where the resource email id(already inserted in "Resource" list earlier) will be typed by me. There is a field which will capture the project name.
    Issue in "Contract" list:
    When i type the resource email id and click on the people picker icon , the project field in the form should get auto populated with the corresponding project of the existing resource so that i donot have to type the project name again. This project info
    should be fetched from "Resource" list only.
    Please let me know how i can achieve this by OOTB approach .
    Regards,
    Guru

    try these links:
    http://sharepoint.stackexchange.com/questions/103682/autopopulate-form-fields-based-on-selection-in-people-picker-column-using-javasc
    http://sharepoint.stackexchange.com/questions/80261/people-picker-not-getting-populated-in-the-sharepoint-site
    http://blogs.technet.com/b/anneste/archive/2011/11/02/how-to-create-an-infopath-form-to-auto-populate-data-in-sharepoint-2010.aspx

  • Hiding field borders in Designer form based on PDF static artwork

    Anyone know the logic behind this?
    It seems that if you create a form from scratch in LiveCycle Designer ES3, you do have the possibility of setting edges for e.g. text fields to be None - rendering them usable (you can tab to them), but invisible. However, given there is no underlying artwork, you probably would not want this.
    However, when you are basing a form design on a PDF artwork (e.g. from InDesign) when you are far more likely to want your fields to be 'invisible' - Designer does not allow it.
    So, if - for example - your PDF artwork contains some great 'graphic' field areas that you want to make fillable in Designer, you seem to have to endure having Designer plonk its own 'lines and squares' on top (not so pretty).
    This seems an odd state of affairs - it seems obvious that if you are bringing in pre-existing artwork, then in most cases the fields will have been done by the DTP person (to keep the graphic integirty of the design). So, anyone bringing it into Designer would assume that Designer could put interactive fields on top, but as 'see through' fields - just as Acrobat can do.
    Is there any technical reason why Designer can't do this? Seems a bit weird.

    Hi,
    Seems that the images in your post are broken, it would be better if you could edit your post and upload the correct images again, others who with the similar questions would get something helpful from it.
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • How to construct a sql query when field having single quote

    Hi all,
    I have been working on web application , here is my requirement:
    I'm constructing sql statement dynamically from dynamic user input (form data). In one of the field having single quote.
    while executing the query it is getting problem because of single quote .. so how do i resolve my problem.
    single quote should be there. (I'm using Ms-Access as my database).
    Thanks in advance
    abel

    Use PreparedStatement. Always. It not only eases setting Java objects in a SQL query, but also protects you against SQL injections.
    Prepare yourself: [http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html].

  • Based on DDL value ,How to make few other fields visible in Adobe forms in SAP CRM??

    Hi All,
            I need to make few fields visible in adobe forms, based on the dropdown value which user selects.....

    Hi Vignesh,
         In the "EXIT" or "CLICK"event of the particular Drop down field you can write the below code(in Java script).
    if (this.rawvalue == <value> )
          <field name>.presence = "invisible";
    else
        <field name>.presence = "visible";
    Thanks,
    Ashok N.

  • How to display errror message in a form based on a procedure

    I created a single-level form based on a procedure. In this form, I would like to generate an error message inside of a custom button, so I used the following inside of that button:
    p_session.set_value (p_block_name => 'DEFAULT',
    p_attribute_name => '_STATUS',
    p_value => 'Please choose a valid chair from the popup icon.');
    Unfortunately, it returned a WWV-0000 error code without any error messages. I use that code in another single-level form based on a table/view, and it works fine, but I need a single-level form based on a procedure. Therefore, I want to know if that code snippet can be used in a form based on a procedure or not? Do we have any other ways to display error messages in pl/sql besides p_session.set_value(...);
    Thanks in advance.

    Somebody please response.

  • Syntax for sum in Smart Form based on Selection criteria in Program.

    Hi,
    We have created smart form for printing confirmation entries in desired format. We have given some selection criteria in the program. Now, we want to do the sum of certain fields in the smart form based on selection criteria given in program and selection screen.
    But we are getting wrong sum in the smart form than expected.
    When we debug the program during run time, we are getting correct records as per our expectations. But result of sum in the out put is not as per given selection criteria.
    Do we need to establish link between "select option" and "Smart form"? How can we use internal table created for select option in the smart form?
    Thanks & regards
    Vijay

    Hi,
    There will be no option to sum the values in smartforms, You just have to sum and append the data to internal table and display the internal table data in the form.
    Regards,
    Satish

Maybe you are looking for