Forms 6i: Unpredictable LOV behaviour

Hi,
I'm trying to modify a forms 6i LOV to return a list of custodians based on information that is in the form at this time. The form is tabbed, and the tab I'm using has multiple records - with an LOV in each record. The problem I'm having is that sometimes the LOV will return a long list of custodians, sometimes just a couple, and sometimes none (no data found). Furthermore I always get the same result for each record, even if that record has a different status (HGF,GVS,Project) - A Pool status is supposed to return no results in the LOV, and I have structured the query such, but it returns the same results as the other records.
I thought maybe the LOV wasn't reading the values right from the active record, so I made some temp fields and created an LOV button that first copied the fields of interest from the active record into temp fields located at the bottom, and the called the List_Values, but the LOV displayed exactly the same behaviour. With the current code, listed below, I get a long list of custodians returned by the LOV regardless of which record's LOV I activate.
The code below is the original code without putting in the temp fields. I hope someone can explain why the LOV is behaving like this, and help me to resolve the problem. Here is the code for my LOV:
SELECT distinct RTRIM(surname) || ', ' || given_names name, v.custodian
FROM vbm_hr_emp_driver c, VBM_CUSTODIAN v, VBM_CUSTODIAN vc
WHERE c.employee_no = v.custodian
AND :VBM_VEHICLE_STATUS.STATUS IN ('HGF','GVS','Project')
AND vc.custodian = v.custodian and vc.status = :VBM_VEHICLE_STATUS.STATUS
AND TO_DATE(TO_CHAR(:VBM_VEHICLE_STATUS.FROM_DATE,'dd-MON-yyyy hh24:mi'),'dd-MON-yyyy hh24:mi') >= vc.from_date
AND (TO_DATE(TO_CHAR(:VBM_VEHICLE_STATUS.FROM_DATE,'dd-MON-yyyy hh24:mi'),'dd-MON-yyyy hh24:mi') < vc.to_date
OR vc.to_date IS NULL)
AND (TO_DATE(TO_CHAR(:VBM_VEHICLE_STATUS.TO_DATE,'dd-MON-yyyy hh24:mi'),'dd-MON-yyyy hh24:mi') < vc.to_date
OR TO_DATE(TO_CHAR(:VBM_VEHICLE_STATUS.TO_DATE,'dd-MON-yyyy hh24:mi'),'dd-MON-yyyy hh24:mi') IS NULL)
ORDER BY Name
Is it that LOV's can't be dynamic - ie: they have a predetermined list of results that can't be changed by variables? Please help as this is driving me mad.
Thanks
Adam

AND TO_DATE(TO_CHAR(:VBM_VEHICLE_STATUS.FROM_DATE,'dd-MON-yyyy hh24:mi'),'dd-MON-yyyy hh24:mi')
>= vc.from_date
AND (TO_DATE(TO_CHAR(:VBM_VEHICLE_STATUS.FROM_DATE,'dd-MON-yyyy hh24:mi'),'dd-MON-yyyy hh24:mi')
< vc.to_date
OR vc.to_date IS NULL)
AND (TO_DATE(TO_CHAR(:VBM_VEHICLE_STATUS.TO_DATE,'dd-MON-yyyy hh24:mi'),'dd-MON-yyyy hh24:mi')
< vc.to_date
OR TO_DATE(TO_CHAR(:VBM_VEHICLE_STATUS.TO_DATE,'dd-MON-yyyy hh24:mi'),'dd-MON-yyyy hh24:mi') IS NULL)
That is a terrible mess for date comparison. This is equivalent:
    AND  :VBM_VEHICLE_STATUS.FROM_DATE >= vc.from_date
    AND (:VBM_VEHICLE_STATUS.FROM_DATE  < vc.to_date
                                       OR vc.to_date IS NULL)
    AND (   :VBM_VEHICLE_STATUS.TO_DATE < vc.to_date
         OR :VBM_VEHICLE_STATUS.TO_DATE IS NULL)

Similar Messages

  • Populate field on form based on LOV selection

    I have a form that I created on Portal 3.0.7. On the form is a LOV which has a list of employees. I want to populate another
    field on the form which is office and it is based on the employee LOV selection. I also want the field to be filled immediately,
    not after a button is pressed or any other user intervention. I have been able to do this with a dependent LOV, but it does not look
    appealing. Both of the fields are coming from the same table. It seems like this should be easy to do, but I am not
    having much luck. Can someone please tell me the best way to accomplish this.

    Hi,
    Yes, you can do it using Dynamic Actions.
    See this thread as well. APEX4: Populating fields from database based on the SelectList value
    In Radio Group you will need to identify the button clicked from its ID and / or value. Thats because the Radio Group Item creates as many IDs / Items as there are options P1_ITEM_0, P1_ITEM1_1, etc.
    Regards,

  • Weird LOV behaviour - delay when go_block,go_item

    Hi,
    I have a lov and after the user selects a value I go to another block and execute a query. Problem is that after I check the return value of show_lov and find it true, it takes some 3-4 secoonds for the code to execute if it had a go_item or go_block statement.
    To understand it better:
    a := SHOW_LOV('LOV_ALL_EMP');
         IF a = TRUE THEN
    IF HERE I PUT A GO_ITEM OR GO_BLOCK STATEMENT (WHICH IS NEEDED TO EXECUTE QUERY THEN) I TAKE A 3 SECOND DELAY FOR SOME REASON (ONLY AT THE FIRST GO_BLOCK OR GO_ITEM IF I HAVE 2 OR MORE I GET THE DELAY ONLY AT THE FIRST. OTHER STATEMENTS DONT STUCK.
    ELSE
    IF USER DOES NOT SELECT A VALUE DELAY DOES NOT OCCUR EVEN IF I USE GO_BLOCK
    END IF;
    To put it more generally:
    When I execute a the first GO_ITEM or GO_BLOCK statement AFTER the call of a LOV it seems to stuck for a little.. Even if statement refers to the block already focused. Also for the delay to occur, user have to select a value from LOV i.e. if user does not select a value (and show_lov returns false) this delay does not happen. Why?
    Any ideas on this strange behaviour please?
    regards,
    teo

    Well Steve,
    seems it's something like that. What I did is to check if it is the same on other PCs in here and it is the same, but unfortunatelly I wouldnt have the opportunity to check it on an OS other than XP home. Laptop I use for testing over the Web has Win 2000 but I use PSTN there so speed is totally different and I can't tell if there's a difference.
    Anyway I really don't have too much time to lose on that (it seems tricky) and moreover I don't think I'm using LOV in this case cause UI seems too poor for my requirements so I'll do a 'LOV' by myself.. So I will abandon this although its interesting. If later on I find anything else or be able to test it on another OS I'll get back on this post.
    I really appreciate your interest.
    For the history:
    Forms 9i on AS9i
    Win XP Home on which lies the AS9i (same used as a client)
    DB server 9i on other PC in the LAN

  • Resetting a Form with Cascading LOVs (Apex 4)

    A standard reset button cannot reset cascading LOVs properly. Let's assume we have a parent LOV and a child LOV. When one changes the selection in the child LOV, reset can undo this. But when he changes the selection in the parent LOV, reset will undo only the parent LOV but not the child LOV. The child LOV remains unchanged (however the selection is lost) and therefore shows a list that does not correspond to the entry now shown in the parent LOV.
    Has anybody found a solution for this, a reset action that can reset cascading LOVs completely and properly?
    Regards
    Roland

    Roland,
    i didn't try this myself but maybe you succeed with triggering the onchange-event of your parent-select-list (this should cause the child select-list to be refreshed).
    Or you could try if a form region has a apex "refresh" event (i know that refresh works on reports).
    brgds,
    Peter
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    BuilderPlugin: http://builderplugin.oracleapex.info
    Work: http://www.click-click.at

  • Populating all the columns in a form based on LOV

    Hi people,
    I got a forms which has around 20 fields ...i created this using the data block wizard....
    when i compile and run the form... i get the form screen... and when i click the default execute_query button i get the records the way i want ....
    but the problem is there are around 11000 records ....so for that i created an LOV based on the ID and the description
    Now
    I want to populate my blocks based on the ID that i select from LOV ....
    can 1 help me accompalish this task...
    one thing that i have in mind is using SET_BLOCK_PROPERTY
    but when i use it i am not able to execute to perfectly...

    Hello,
    If you want to populate the block by selecting value from LOV in the same block. Then make the life simple.
    1. Open your form in ENTER_QUERY mode.
    2. Let the user choose value from LOV.
    3. Then just simple perform exequte query.
    It will search upon the selection..
    Or there is new block for search cirteria then you will have to use the SET_BLOCK_PROPERTY as you mentioned like...
    For Numeric...
    SET_BLOCK_PROPERTY('BLOCK_NAME',DEFAULT_WHERE,'COLUMN_NAME = '||:SEARCH_BLOCK.FIELD_NAME);
    For Alphanumeric
    SET_BLOCK_PROPERTY('BLOCK_NAME',DEFAULT_WHERE,'COLUMN_NAME = '''||:SEARCH_BLOCK.FIELD_NAME||'''');Use the above code on your required trigger where you need to populate the records based on selection.
    -Ammad

  • Tabular form with Popuv LOV doesn't work with onchange event

    Hi all.
    I have a problem with tabular forms, Popuv LOVs and javascript.
    I have created one tabular form, I want to put a value in "my_field" field when a user selects a new value from other field called "my_list", I have this code:
    <script type="text/javascript">
    function putValue(pThis)
        var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
        html_GetElement('f06_'+vRow).value = '0000';
    </script>and this for Element Attributes:
    onchange="putValue(this);"Everything works well when I choose "Display as Text Field", but if I change this option to "Display as Popup KEY LOV" or "Popup LOV" it doesn't work, I mean "my_field" stays without any value.
    I'm using Oracle Application Express Release 4.0 and Oracle 11g
    Please help.
    Regards.

    Hi Peter.
    Thanks, yes, in fact the position of my column changes, but it doesn't work even with the correct element, I have made a lot of proves and it seems that APEX constructs POPUPS LOVS in a different way and that's why "onchange" does not work.
    With this thread: Re: onchange not work on popup lov for a field on collection I have a half solution, It works for existing rows, but it doesn't for added rows.
    I have solved this problem calling a function that set the onchange event to every row when "ADD ROW" button is pressed, now it works without problems.
    Regards.
    Oscar.

  • Oracle 10g forms pops up lov twice

    Using Oracle Forms version 9.0.4.0.19 on Windows XP SP3.
    I have a form with three tab pages. Two of the tab pages have two vendors list of values one with points of contact used for insert mode and one without points of contact used for query mode. In the first tab page the vendor information is not required to create a record but in the last tab page it is.
    In both tab pages I have mapped the vendor record id and name to the list of values containing points of contact and populated them in a around about way using control variables for query mode.
    During runtime when a user enters a new record on the first tab page and selects one of the vendors that has multiple points of contact the lov pops up again when the user navigates out of the master data block and into the details data block. If the user doesn't leave the master block the lov doesn't pop up again. The details block doesn't call the vendors list at all and has nothing to do with vendor information.
    Once the user selects the vendor twice the form moves on and the record can be saved. I have found that it doesn't matter if the fields are set to validate against the LOV or not and it doesn't matter if the LOV name is specified in the item properties or not. Also, it doesn't matter how many points of contact the vendor has if it has a least two the lov will pop up again.
    Please help! I don't know if this is an anomaly in forms because the list of values with vendors and their points of contact is a master detail relationship all its own.
    Thanks,
    c

    I have found that it doesn't matter if the fields are set to validate against the LOV or not
    and it doesn't matter if the LOV name is specified in the item properties or not.What? If the LOV is not specified in the property palette of an item, there is NO WAY it is going to pop up no matter what. And if you set validation to No, they should never pop up, either.
    The issue is caused by your multiple "points of contact" (I assume these are the first column of the LOV).
    To stop that behavior, you need to set the Validate from LOV to NO, and do your own validation. I have posted a generic PLL_Record_Group_Lookup in this forum that would help you -- just use the sequential search method.

  • Need equivalent of Oracle Forms Row-Level LOV

    I came very close, but I am stuck on the last item.
    I am trying to build an update form. I have a select box at the top, and when I select a new value, I want it to change all of the values on the form (for update) to the record associted with the value I chose in the Select Box.
    I did this with the Master Detail wizard, although I believe that a "Form with a Report ", would work too. With the Master Detail Wizard, I choose "Edit detail on separate page", which creates the page that I am after, then I just delete the others. I then go to the last page (i.e., edit detail), and change the non-displayed primary key to a "Select List with Redirect" and then associate the desired LOV.
    It works pretty nicely one I select a value, and it performs the redirect. However; I can't seem to get the form to pre-populate upon startup.
    I tried defaulting the Select List, it does not pull in the detail data, unless I select something with the selct box.

    Just three last questions.
    1) If I want to call another similar form and have it start on the same item that I currently have selected in the select box, how would I pass that parameter, and how would I receive that parameter? I currently create a link on the first page, and use the following to call the second page:
    LinkName
    2) Is there an easier way to do what I am trying to do other than using a Master Detail Wizard, or Form with a Report. When I use the wizrd to create a single form, it seems to default to an Insert Form, and is missing the necessary function to do what I like.
    3) In my first two forms, a record will always exist before I navigate to it. However; I have another class of form, that may not have a record yet. Do I need to create this form differently, or will the approach I've taken above still work if I need the form to do an insert rather than an update into the associated detail table?

  • Strange LOV behaviour in new rows (UIX)

    Hi all,
    we are using UIX for a JHS implementation project and came across a "JHS-00107: Table data are out of date, please requery" error while testing our JHS-generated forms. The problem arises in a table with multi-row-insert enabled where some of the (hidden) fields are already filled in by default (using the application structure -> view object editor). If we then select a value in the LOV and it is returned to the base page, the error is generated and the selected LOV value does not appear. Also, the row is marked dirty and asks for submission if I try to navigate to another page afterwards.
    If we leave out the defaults, no error is generated.
    Is there a workaround possible for this problem, as we would very much like to keep the default values in there ?
    Also (but this is not really important to our case), an LOV always seems to return its selected value to the upper new row, even if a second or third new rows LOV button was used.
    Best regards,
    Benjamin

    Sandra,
    here's my scenario:
    + I unzipped the jhsdemo, adapted connection settings for my db and set the paths in appstructure files to the path i unzipped to
    + In the model project, I extended the Subordinates viewobject with the DepId attribute of the Employee entity object.
    + In the appstructure file of the viewcontrollerinternal project, I set use table range to false, enable insert multiple rows and set the new rows property to one for the subordinates group (subgroup of employees). I also added an LOV to this group for selecting the Department.
    + using the JHS viewobject property editor for the subordinates group, i set the display and display in tables value for FirstName to hidden and set a default value '${bindings.EmployeeFirstName}' for the same column.
    + Finally, I reran the JHS app generator
    in this case, if I select a department using the LOV, after returning from the LOV popup, nothing changes (so the LOV value is not shown on the page)
    If I set the display to true again and do the same for the EmpId attribute (hiding it and filling in '${bindings.EmployeeId}', which is the Id of this subordinates manager), the "JHS-00107: Table data are out of date, please requery" error appears as soon as I try to select a value from the LOV.
    I guess the second case means the error has something to do with the foreign key relationship which I try to give a default value. I think for this particular situation (entering a default value of the manager), JHS would take care of the FK link automatically by itself, but at least in the first case the LOV doesn't really do what users might expect ?
    Best regards,
    Benjamin De Boe

  • Strange lov behaviour

    i've a datablock 'employees'.
    i've a lov 'locations' with columns 'id', 'name' and 'desc' where 'id' is not displayed.
    the lov-table looks like this:
    ID NAME DESC
    1 BE Bern
    2 ZH Zurich
    3 ZH Zurich2
    4 GE Geneva
    employees.location is FK to location.id
    when i choose ZH-Zurich from the lov and want to save the changes, the lov is displayed again. and after choosing ZH-Zurich again, the changes are saved.
    i set validate from list property of the text-item which holds ZH to YES.
    i know that 'NAME' is not unique in my lov. does the first column in the lov have to be unique when i set "validate from list property" to YES?

    I have a similar problem in Forms 9i. I have fields with LOVs and Validate from list set to Y. If I type in a value or populate it as an initial value or from another LOV, when I commit the record the LOV pops up even though the value in the field is on the fields own LOV. If I then select the identical value from the LOV it commits quite happily.
    Similarly on another form if I populate a field with an initial value or type it in, the LOV pops up but if I select the identical value (in this case 'Y' or 'N' - not exactly complicated) from the LOV, it is fine.
    This problem seems to occur on some fields but not on other seemingly identical fields, but it is consistent in that on the fields where it does occur, it always occurs. I have checked the SQL in the record groups and it is all correct. And in one of the cases above there are only 2 static values - Y or N - how can they be wrong?

  • Forms Builder 10g LOV

    I'm a Beginner of Form-Builder. My Questions:
    1- I habe read that you can display a LOV at Runtime by pressing a LOV-Button. Does this exist?
    2- For the LOV-Property "Automatic Select" you habe to set "Automstic confirm" to YES. How can I do this? Is that a Property? Of which Oject?
    3- At Runtime I like to expand the Default-Viewport of the Javaservlet (It's not the Viewport of my Form-Modul). I suppose, that I have to change the Parameter WIDTH and HEIGHT of a .html file. Have I right or how kann I do that?
    Thanks you so much for any of your Answer!
    Frank

    Duplicate Post.
    sarah

  • Forms 6i count lov columns

    Please dear sirs, I want to count the lov columns, and also i want to get the column title of the lov, and i use forms 6i , i know that there is "UTL_LOV.Get_LOV_Column_Property" but i can not use this package because i use forms 6i please please help me

    One solution I have encountered to get around this limitation is to LOOP from 1 .. X (where X is the max amount of LOV columns you would ever expect a LOV to have, like 10 for example).
    And make a call to SET_LOV_COLUMN_PROPERTY, and then check FORM_SUCCESS immediately afterwards, If FORM_SUCCESS=TRUE, then you know the set worked, so you know that LOV column must exist.
    Not ideal by any means, but better than nothing.
    It works for most forms, alas for one form it is not working and I cannot figure out why (it throws FRM-41364, which I cannot catch).

  • How to refresh Portal form with dependent LOVs ?

    I have a portal form which has dependent LOVs, the first LOV is
    a Site LOV and the next LOV is a Teacher LOV. Once a Site is
    selected, the form refreshes to load the Teacher's LOV with
    teachers belonging to the selected Site.
    In some cases the Site is assigned internally (using Javascript)
    in such cases the form does not refresh automatically; which
    causes the problem, as all the Teachers of all the Sites are
    loaded in the LOV.
    Any suggestions are welcome.
    Thanks,
    Hilal

    Put this code into the javascript onChange event of the list box
    that you want to automatically refresh the screen with:
    do_event(this.form,this.name,1,'CUSTOM','');
    that should cause the screen to refresh when an item is chosen.
    at that point, the 2nd list box (if you used the :paremter in
    the LOV and bound it to the right field in the form) should come
    up with the proper set of values Thanks Michael,
    But my problem is not with that part of refreshing; that is
    refreshing, when a value is picked from the first LOV to re-load
    the second LOV works fine.
    My problem is only when the value of the first LOV is internally
    set, the form does not refresh to re-load the second LOV. The
    value of the first LOV is loaded(internally) using one of the
    fields in "wwsec_api.person_info", eventhough this value is set,
    it does not trigger a refresh to re-load the dependent second
    LOV.
    I guess a solution to this problem would be to explicitly
    refresh the form (I am not able to figure out how).
    Hope I have clarified myself.
    Thanks.

  • Unpredictable Program Behaviour

    Hi there,
    I'm pulling my hair out with this and I thought I'd see if the greater Java experience of others might be able to shed some light on the problem. There is a large amount of program code I have written, which is itself within a larger project so I can't simply post it. However, I will outline the problem...
    The issue:
    My code does not return predicatble results from a simulation. Each time the simulation is run, various statistics are recorded. Despite the fact that the code is identical (!), the results produced differ between executions.
    Things I am pretty sure are not a problem (although if you think there's a "gotcha" please shout out):
    - A random number generator is used but it is seeded with the same value each time.
    - The program is single threaded so race conditions should not be an issue.
    - Behaviour occurs in both debug mode, standalone jar and normal execution from the IDE (I'm using eclipse).
    - Static members are used between objects in lists. The for-each construct is used, but this should execute in the same order each time.
    - In the case of sorting the lists just mentioned, Collections.sort() is utilised and so should be stable (again, lists should be ordered in the same order)
    Can anyone think of something I might be overlooking here? This seems unfathomable at the moment!
    Thanks!

    JavaDev12345 wrote:
    If I could minimise the problem to a short, self contained, correct example that would fit into a forum post then I wouldn't need to be asking - I would debug it myself and rewrite the offending section!So asking a bunch of people who have no access to any of your code seems like a more reasonable approach? What did you expect to happen?
    I am asking for general advice for something I may have overlooked, from people who may have experienced something like this before. You haven't even really described what "something like this" is. "Unpredictable results" is about as helpful as saying "my program doesn't work". Even assuming we could (or would) magically tell you what your problem is, you really think you've provided enough information?
    There can't be that many ways to introduce unpredictability into a program.Then it shouldn't take that long to track down, neh? Add some print statements to see where your "results" start becoming "unpredictable". Or use a debugger. Either of those approaches is going to be much more effective than the one you've taken so far.

  • How to populate form data after LOV search on primary key

    This is the description:
    Pg. 1 contains an item defined as P1_CUSTOMER_ID (Popup Key LOV (Displays description, returns key value) with the list of values definition:
    select
    last_name || ' , ' || first_name display_value, cust_num return_value from customers order by 1
    Pg. 1 contains a button defined as P1_FIND_NOW (Redirect) with a URL redirect to Pg. 4.
    Pg. 1 contains a branch defined as Go To Page 4 (after processing), branch point = On Submit: After processing, action = page in this application, When Button Pressed = P1_FIND_NOW
    Pg. 4 contains two regions with multiple items, for example P4_ADDRESS_1, Display as Text Field (disabled, does not save state), Source Used = Always, replacing any existing value in session state, Source Type = Database column, Source value = ADDRESS_1
    Pg. 4 contains a process (before region) defined as POPULATE_CUST_INFO, Process point = On load, before region, Process error message = Customer could not be found, Source process =
    BEGIN
    SELECT
    CUSTOMERS.FIRST_NAME,CUSTOMERS.LAST_NAME,CUSTOMERS.BIRTH_DATE,
    CUSTOMERS.SEX,CUSTOMERS.MARITAL_STATUS,CUSTOMERS.PHONE_NUMBER_V,
    CUSTOMERS.PHONE_NUMBER_M, CUSTOMERS.ADDRESS_1,CUSTOMERS.ADDRESS_2,
    CUSTOMERS.ADDRESS_3,CUSTOMERS.CITY_NAME,CUSTOMERS.STATE_CODE,
    CUSTOMERS.ZIP_CODE,CUSTOMERS.COUNTRY_CODE
    INTO
    :P4_FIRST_NAME,:P4_LAST_NAME,:P4_DOB,:P4_GENDER,:P4_MARITAL_STATUS,
    :P4_VOICE,:P4_MOBILE,:P4_ADDRESS_1,:P4_ADDRESS_2,:P4_ADDRESS_3,
    :P4_CITY_NAME,:P4_STATE_CODE,:P4_ZIP_CODE,:P4_COUNTRY_CODE
    FROM CUSTOMERS
    WHERE :P1_CUST_ID = CUSTOMERS.CUST_NUM;
    END;
    I am getting the pop-up LOV and selecting a customer from the LOV, then clicking the FIND NOW button. This redirects to Pg. 4 where I expect to see all the data for the selected Customer populated into the various text fields (name, address, etc.). What is actually happening is I'm being redirected to Pg. 4 but
    the Process error message = Customer could not be found is displaying.
    If I run the same Source process query within SQL, I get a screen to
    enter bind variables, I enter an existing customer number (e.g.Y0001), and I get the message:
    ORA-06502: PL/SQL: numeric or value error
    The primary key for the CUSTOMERS table is CUST_NUM varchar2(17)

    Your message refers to "P1_CUSTOMER_ID" and "P1_CUST_ID". Is that a typo in the message? If not, perhaps that's the problem.
    Rodney

Maybe you are looking for