Populate non database items with lov

Hi,
Let's say that I have one database block with 2 columns ID and NAME.
Only ID it is a not displayed database column, and NAME it is a displayed text item with an lov which retrieve data for both columns.
How can I do, to populate the non database item NAME after querying the block, without using POST-QUERY trigger and select into statement.
Thanks.

Hi Gabriel
How can I do, to populate the non database item NAME after querying the block, without using POST-QUERY trigger and select into statement.u can't do that but with using POST-QUERY trigger and select into statement.
This Trigger fires the action of populating the non-db item block Level after executing query...
Regards,
Amatu Allah

Similar Messages

  • How to Populate a List item with LOV'S

    How to Populate a list of items with Lov's
    and then how to dynamically change the Values of one LIST Item
    Based on the Value of anothe List item

    976798 wrote:
    --Hello..I want to ask that How to bind a list item with  table values? this below code does not populate items from database to list item.Pls any body give me solution.
    declare
         group_id RecordGroup;
         list_id Item:=Find_Item('LST_CLASS');
         status number;
    begin
         group_id:=Create_Group_From_Query('Answer_List','select CLASS_ID,CLASS_NM from CLASS_MSTR');
         status:=Populate_Group('Answer_List');
         message(to_char(status));
         Populate_List(list_id,group_id);
         end;Welcome to the Oracle Forums. Please take a few minutes to review the following:
    <ul>
    <li>Oracle Forums FAQ
    <li>Before posting on this forum please read
    <li>10 Commandments for the OTN Forums Member
    <li>How to ask questions the smart way
    </ul>
    Following these simple guidelines will ensure you have a positive experience in any forum; not just this one!
    Check this link: How to Dynamically Populate a Pop List ?
    Hope this helps
    Hamid
    If someone's response is helpful or correct, please mark it accordingly.

  • Searching in non-database items

    Hi,
    I have a block of which the source is a table.
    There are some non-database item in the block.
    Actually these fields are from another table.
    In the post-query, I populate the non-database items with the table.
    My question is : normally I can use 'Enter Query' to seach the records in
    the database column. How can I perform seaching with non-database items ?
    Thanks
    Ivan

    In a pre-query trigger alter the where clause of the main block to query the main table based on non-database values...
    Use the set_block_property procedure and the 'DEFAULT_WHERE' clause or the 'ONETIME_WHERE' property...
    example...
    set_block_property('MYBLOCK', ONETIME_WHERE,
    'where main_table.id in (
    select id from my_non_db_block_table where mycol = :my_non_db_field)');
    To accept wild cards you will probably have to change the = to a "like" above..
    You will have to build your where clause by adding a "and" condition for each non-db field.
    Message was edited by:
    Mark Reichman

  • Problem with non-database item

    I have a 10g rel 2 form that has a post-query trigger that populates a non-database item. The non-database item has a when-validate-item trigger which I only want to fire when the user changes something in that field not at query time because it causes the form status to be changed. How can I either prevent this trigger from firing in query mode or test within the trigger that I'm in query mode so that the logic won't get executed?

    Put this at the top of your when-validate trigger:
      If :system.mode = 'QUERY' then
        return;
      End if;I have found that post-query activity often causes ALL when-validate triggers at the item and block level to run. So you may need those three lines in every when-validate trigger.

  • How to include non database item in the query

    Hi
    I have a Master-Detail form. where in the detail block one of the field is text item 'X' attached the list of values(Y). Master block includes non database items which is based in the decoding result of the database items for example:
    Gender(Male, Female)>> non database item
    Gender_id(M,F)>>database item
    the form is created based on the template.fmb form for apps. When I run the form in the query mode, i can query about any database item while including query about others non database item does not affect.
    how to can i modify it so this could be handled??
    I know that one way to avoid this issue is to create a view with all my desired field.
    but there should be away to override the build in query used by oracle apps...
    any one has a link, source, document... etc that help on this??
    any idea how to do it without creating a view??
    thnx alot

    Hi HST,
    You can code the handling in POST-Query of the corresponding block to retrive the corresponding data depending on the Queried data.
    Regards,
    Kiran

  • Function not returning database rows properly in non-database item

    Hi,
    I have 3 database items that I'd like to concatenate into one field and display it in a non-database item. I have setup two different methods to do this for testing purposes. First, I created three separate database items (SECTION, ROW, & SEAT_NUM) and a non-database item (SEAT). I created a formula (in SEAT) to do the concatenation and this way works fine. For my second method, I created a function where I selected the 3 fields and performed a concatenation into a single value to be returned in a seperate non-database item (SEAT_TEST).
    Here's my function:
    FUNCTION SeatLocation(p_id IN event.id%TYPE)
    RETURN VARCHAR2 IS
    CURSOR a IS
    (SELECT ltrim(rtrim(event.section,' '),' ')||' '||
    ltrim(rtrim(event.row,' '),' ')||' '||
    ltrim(rtrim(event.seat_num,' '),' ') seat
    FROM event
    WHERE event.id = p_id);
    BEGIN
    FOR rec IN a LOOP
    IF rec.seat IS NOT NULL THEN
    RETURN rec.seat;
    ELSE
    RETURN ' ';
    END IF;
    END LOOP;
    END SeatLocation;
    And I'm calling it in a POST_QUERY trigger with the following: :event.seat_test := SeatLocation(:event.id);
    I put both non-database items side-by-side, run the form, and the first method works fine. I doesn't quite work for the function to display in SEAT_TEST. For my program, an ID can have multiple seat locations and I'd like to display all those seats as I scroll through the form (for a given ID). What the function is returning is only the first records seat location even though there are two more locations (from the remaining two records) that need to be displayed, but are not. It works fine for the formula method. Is there a work around this within my function code and/or the SEAT_TEST item? I'd like to keep my function instead because I could use the code elsewhere. I thought that since there is more than one record retrieved for a particular ID, the for loop would return one value each loop iteration and display the different value seat locations as I scroll/arrow down through the form. I didn't know if you had to call the POST-QUERY trigger multiple times for the number or records you retrieve in the cursor. I hope this makes sense.
    Any advice would be greatly appreciated.
    Thank you,
    Eric

    Even though your function is written to loop through multiple records, as soon as it hits the first one inside the FOR loop, it returns that value. The Return command is an exit, so the function is done, and you cannot expect it to magically run a second time just because the cursor found more than one row.
    You need to pass the function all the parameters to form a unique key into the row you are looking up. ID is not unique.

  • Querying a record from a non-database item

    I am working in Apex 4.0. I have a page based on a table with the following columns: dktnr, borrower, amount, previous_dktnr, subsequent_dktnr. The precious_dktnr is the dktnr under which the loan was financed in the past, before its assumption or refiancing. The subsequent_dktnr is the dktnr under which the loan is later identified. When a loan is refinanced, it is assigned a new dktnr in a new record, and the old dktnr is placed in the previous_dktnr column of that new record, and the current dktnr is placed in the subsequent_dktnr column of the old dktnr record.
    I created two buttons, one for the previous_dktnr and one of the subsequent_dktnr. When I click either of these buttons, the action redirects to the current page and places the value of either the previous or subsequent dktnr into the dktnr item. This queries the record for the dktnr that has the same value as the previous or subsequent dktnr.
    This works. It allows the user to shuffle back and forth between the two dktnr's.
    One would assume then that, if a non-database item were created, say :P22_QUERY_DKTNR, you would be able to enter an existing dktnr into that item and have a button, using the same logic as the previous and subsequent dktnr buttons, that would be able to return the record for the dktnr entered.
    I have tried this, and it does not work. Can anyone tell me why it does not work?
    Edited by: Doug on Apr 9, 2011 3:42 PM
    Edited by: Doug on Apr 9, 2011 3:43 PM
    Edited by: Doug on Apr 9, 2011 3:43 PM
    Edited by: Doug on Apr 9, 2011 3:45 PM
    Edited by: Doug on Apr 9, 2011 3:46 PM

    Doug,
    Made copies of your two page within your workspace, page 3 & 4.
    The issue was the page did not have a value in session containing your Look_Up value. I altered the Look-Up button to Submit the Page so as to capture the Look_Up value and then added a new Page Branch that was sequenced prior to your existing branch. This new branch sets your P4_DKTNR with the Look_Up value and then returns your results.
    Jeff

  • When-validate-record trigger only if  a non database item is changed

    Hi,
    I am trying a code in the when-vaidate-record trigger in the BLOCK level.
    The trigger should fire only if a checkbox item value is ticked(Value ='Y) for the present record(i.e, if already existing other records have a value ticked (='Y), it doesnt matter and trigger shouldnt fire)
    Please help me achieve this :
    The code I have tried in when-vaidate-trigger, which does not work as what I want :
    DECLARE
    X NUMBER;
    BEGIN
    if
      nvl ( :DEFLOC.to_be_defaulted, 'N' ) = 'Y' and :DEFLOC.COMMENTS is NULL
      and :SYSTEM.RECORD_STATUS ='CHANGED'
         then
        set_alert_property(
             'err_alert',
             alert_message_text,
             'You must enter a comment when defaulting localities.');
              x := show_alert('err_alert');
              RAISE FORM_TRIGGER_FAILURE;
              end if;
    END;The above code does not fire at all..
    If I remove the part,
    and :SYSTEM.RECORD_STATUS ='CHANGED'
    it fires for "all records"(not just the currently changed records) where nvl ( :DEFLOC.to_be_defaulted, 'N' ) = 'Y' and :DEFLOC.COMMENTS is NULL
    Please help !!
    Note: :DEFLOC.to_be_defaulted is a non database item ; :DEFLOC.COMMENTS is a database item

    Hi kriti,
    There is one more way,
    In the when-checkbox-changed trigger,
    if :your_chk_box = 'Y' then
    set_Record_property(:system.cursor_Record, 'your_blk',status,changed_Status);
    else
    set_Record_property(:system.cursor_Record, 'your_blk',status,Query_Status);
    end if;
    Then it is easy for you to find out the changed records using get_Record_property((:system.cursor_Record, 'your_blk',status)
    Hey let me ask you one Question, is that check_box item is database item ???
    If so,
    it is easier..the fol. code will work for that
    if   nvl ( :DEFLOC.to_be_defaulted, 'N' ) = 'Y' and :DEFLOC.COMMENTS is NULL
      and nvl(get_item_property('DEFLOC.to_be_defaulted',database_value),'N') = 'N'      then
                      set_alert_property(
             'err_alert',
             alert_message_text,
             'You must enter a comment when defaulting localities.');
              x := show_alert('err_alert');
              RAISE FORM_TRIGGER_FAILURE;
              end if;otherwise
    If your are creating that temp. item, it should be in the same block as non-db item.
    I will explain this... You are setting the status of to_be_defaulted check box of some queried record to Y based on some conditions, right?
    These records anyways are not updateable. Now your requirement is to find out the newly checked check boxes.
    So in the post query or the place where you set to_be_defaulted as 'Y, we will default the new item with value Y, so that in the when validate trigger, you
    know which record needs to attacked, It is those records with nvl( new item ,'N') = 'N' and to_be_defaulted = 'Y'...
    Regards
    Dora...

  • Non-Database items in enter-query mode

    I have a form with 2 base table blocks, typical master details situation. I wish to allow a field from the detail block to be queryable from the master block. I was considering adding a non-database item to the master block (visible only when in Enter-Query mode). In a pre-query trigger I would amend the DEFAULT-WHERE property of the master block when the appropriate where clause using the non-database item value. My prototype/test version works fine except the non-database item is not enabled while the master block is in enter-query mode.
    I think basically forms will enable only field s if they are database items and queryable set to yes. There are no more database items I can use to set the non-database item column name property.
    Any suggestions would be appreciated.
    Ralph
    Oracle Developer - Unisys Australia

    Hi Ralph,
    we have several Forms using non-database items as query-items which works fine.
    What we did is following:
    1) create non-database item xy in master-data-block
    2) set property database item to no
    3) set property query allowed to yes
    4) create a pre-query trigger on master-data-block where we change the where-clause (this is forms6i, in 9i we would use the one-time-where-clause)
    Peter

  • About populating a non-database item in a multi-records block

    Hi, all
    I have a problem about populating a non-database item in a
    multi-records block. This block is set to database block with a
    controlled item which needs to be populated after query. so I
    create a post-query trigger, but my problem is when the records
    listed in this block are less than 10 ( the record number is set
    to 10), the trigger fires no problem. but when the retrieved
    records are greater than 10, the error message is 'post query
    trigger raised unhandled exception ora 01403'. anyone can help me
    fix this problem?
    Thanks in advance
    Diana

    Diana,
    When you have an unbound item in a block and want to fetch
    some data into it you need to write a post-query trigger.What
    you have done is right.But it seems that u are getting a No data
    found error.I am sure about how u r populating data into that
    field.If u have written a select statement to fetch the data in
    post-query trigger, kindly handle an exception and find out the
    problem.Having a look at ur code(pos-query) would be much more
    helpful for giving a better solution.Try this a let me know.
    Thanks
    Vinod.

  • How to query on non database item?

    I am working on AP Invoice form. The Invoice Header block based on table ap_invoices_all, I have database items such as invoice_num, invoice_date, and invoice_amount. I also have some non databases item like supplier and supplier number. I added POST_QUERY:
    declare
    supplier varchar2(240);
    supplier_number varchar2(30);
    supplier_site varchar2(15);
    begin
    select aps.vendor_name, aps.segment1
    into :invoice_header.supplier, :invoice_header.supplier_number
    from ap_suppliers aps
    where aps.vendor_id = :invoice_header.vendor_id;
    Also in PRE-QUERY
    declare
    supplier varchar2(240);
    supplier_number varchar2(30);
    supplier_site varchar2(15);
    invoice_num varchar2(50);
    invoice_date date;
    invoice_amount number;
    begin
    select aia.invoice_num, aia.invoice_date, aia.invoice_amount
    into :invoice_header.invoice_num, :invoice_header.invoice_date, :invoice_header.invoice_amount
    from ap_invoices_all aia
    where aia.vendor_id = (select vendor_id from ap_suppliers where vendor_name = :invoice_header.supplier);
    It's showing fine with Suppier iformation I query by invoices, but I doesn't work when I query by supplier.
    Can anyone help? I really appreciate.

    Hello,
    Thanks for your reply. I think I need to clarify my problem
    Your cursor has the same result as what I have in the post-query:
    Select aps.vendor_name, aps.segment1
    into :invoice_header.supplier, :invoice_header.supplier_number
    from ap_suppliers aps
    where aps.vendor_id = :invoice_header.vendor_id;
    and they both work when I query on a database item, such as invoice_num and the non database item vendor name and vendor number will show up. I am doing ok with this.
    My problem is when I query on vendor name field which is not a database item, such as CLARK PUBLIC UTILITIES, it will not return CLARK PUBLIC UTILITIES only, instead it returned all the suppliers. Could you please help with this? Thanks a lot.

  • How to query non database items

    hi every one
    I have database block has database items and non database items
    i want to make query in that non database items to retrieve data by that non database items and database items
    thinks

    Hi Every one
    I want to use the non databsae item in query to retireve data by it
    Example
    In table emp
    emp_id
    emp_name
    Dept_id
    But in Form
    Emp_name
    Dept_name
    When endtr data open lov to retireve Emp name and emp id
    and when enter department name in table enter dept id but in form user see dept name in form .
    but if he try to use dept name in query he can't because it non database item .
    How can i use this item in my query to retireve data by dept name ?

  • Error: there are non exicisable item with cenvat tax code

    I am getting an error message there are non exicisable item with cenvat tax code while trying to add po for pick and pack from sales order. I request all of you to help me with it.
    I have already checked if the item and ware house is exicisable in the check box of the master data.
    Best regards,
    Sandesh.Sreyamsh

    Thanks mahendra and rahul,
    Unfortunately my issue is not solved yet, the tax is not manually created it was created by sap during new company creation. I checked by adding other tax type in sales order but every time when I try to create sales bom it gives the above error.
    @ Rahul the tax is under cenvat type and the Items has been added under exercise transaction. here is what im trying to do
    I created a sales order for 4 of my items.
    Then i try to create po for two of my as pick and pack items by checking Purchase orders indicator under logistics tab of sales order.
    At this point i am getting the above said error.
    All the items i am trying to add is exisable and tax is also of cenvat type.
    Please help me out of this as im stuch very badly in this issue.
    Regards,
    Sandesh.Sreyamsh

  • Check box as a non database item

    Hi.,
    I am using jdev 11.1.5
    My scenario:
    I need to use checkbox in my af:table which is a non database item
    if i check that check box i need to select the current row in that table
    ex:
    yr        period     type
    2010    2            AJ    [checkbox]
    2010    3            AJ    [checkbox]If I check the 2nd period check box then the value of
    Row row= vo.getcrrent();
    row.getAttribute("period");  //   this value must be 2
    check box must be a non-database item
    how can i do this

    is this what you want?
    Row row= vo.getcrrent();
    row.getAttribute("period");  //   this value must be 2
    int index =vo.getRangeIndexOf(row); //Get the index of the given row relative to the beginning of the range. http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e10653/oracle/jbo/RowIterator.html#getRangeIndexOf%28oracle.jbo.Row%29

  • Sort a non database item

    I have one datablock (ma_erz) in my forms based on the table test1.
    Datase-Items of table test1:
    :ma_erz.MAE_ID,
    :ma_erz.MAE_SYSART
    Non-Database-Items:
    :ma_erz.L_KM_USERNAME
    My problem is, that I could not sort the records of a non-database-item.
    Does anybody know a workaround? I would like to sort the records to username.
    I am saving the username in :MA_ERZ.L_KM_USERNAME in Post-Query
    of datablock ma_erz:
    /* CGFK$QRY_LOOKUP_DATA */
    /* Query lookup data for the foreign key(s) */
    BEGIN
    IF (
            (name_in('MA_ERZ.MAE_SYSART') IS NOT NULL)
      THEN
        BEGIN
          CGFK$QRY_MA_ERZ_MA_ERZ_SYS_ERZ(
            :MA_ERZ.L_ERZSYS_ERZ_BEZEICHNUNG,    /* OUT: Value in item :MA_ERZ.L_ERZSYS_ERZ_BEZEICHNUNG */
            :MA_ERZ.MAE_SYSART);                 /* IN : Value in item :MA_ERZ.MAE_SYSART */
        EXCEPTION
          WHEN NO_DATA_FOUND THEN
            MESSAGE('Fehler : Sys Art does not exist');
          WHEN OTHERS THEN
            CGTE$OTHER_EXCEPTIONS;
        END;
        SET_RECORD_PROPERTY(:SYSTEM.TRIGGER_RECORD, 'MA_ERZ', STATUS , QUERY_STATUS);
      END IF;
      IF (
            (name_in('MA_ERZ.MAE_ID') IS NOT NULL)
      THEN
        BEGIN
          CGFK$QRY_MA_ERZ_MA_ERZ_SYS_KM_(
            :MA_ERZ.L_KM_VORNAME,    /* OUT: Value in item :MA_ERZ.L_KM_VORNAME */
            :MA_ERZ.L_KM_NAME,       /* OUT: Value in item :MA_ERZ.L_KM_NAME */
            :MA_ERZ.L_KM_USERNAME,   /* OUT: Value in item :MA_ERZ.L_KM_USERNAME */
            :MA_ERZ.MAE_ID);         /* IN : Value in item :MA_ERZ.MAE_ID */
        EXCEPTION
          WHEN NO_DATA_FOUND THEN
            MESSAGE('Error :  does not exist');
          WHEN OTHERS THEN
            CGTE$OTHER_EXCEPTIONS;
        END;
        SET_RECORD_PROPERTY(:SYSTEM.TRIGGER_RECORD, 'MA_ERZ', STATUS , QUERY_STATUS);
      END IF;
    END;
    /* CGFK$RESET_BLOCK_WHERE_CLAUSE */
    BEGIN
      IF (CG$PROTOTYP_MA_ERZ_V01_GLOBALS.MA_ERZ_WHERE <> 'first_time') OR
        CG$PROTOTYP_MA_ERZ_V01_GLOBALS.MA_ERZ_WHERE IS NULL THEN
        set_block_property('MA_ERZ', DEFAULT_WHERE, CG$PROTOTYP_MA_ERZ_V01_GLOBALS.MA_ERZ_WHERE);
        CG$PROTOTYP_MA_ERZ_V01_GLOBALS.MA_ERZ_WHERE := 'first_time';
      END IF;
    END;

    Or, even simpler, put the following in your order by:
    ORDER BY (SELECT THELOOKUPCOLUMN
                FROM THELOOKUPTABLE X
               WHERE X.MAE_ID=Y.MAE_ID)Additionally, set the ALIAS of the block to Y
    p.s. you could even skip the "ORDER BY" itself.

Maybe you are looking for

  • How do I transfer my daughter's playlists from my iTunes account to her new iTunes account set up on her new computer?

    I have a macbook air.  We each have our own playlist under my itunes account.  I purchased itunes match.  She received a new PC laptop for Christmas.  I would like her to have her own itunes account.  Is there a way to transfer her playlist on my itu

  • MM to FI plz Help Urgent

    Hi, I want to see Purchase order wise report. The report should show PO wise payment in FI. PO field is EBLEN and i am unable to find its link to BSIK or BSAK. The reason is that they are not maintaining EBELN in both these table. I tried on LIFNR bu

  • Still Can't Get Audition CS6 To Launch. Nothing Seems To Work.

    I feel pretty bummed about this program not working. I spent a lot of money, and the Customer Support line wasn't able to help me either. I'm running an AMD 8 Core System (3.1ghz), on Windows 7 Ultimate 64 bit with 16 gigs of RAM. I have made the deb

  • Select a count using the last entry of a table

    I have a huge project for which I am trying to learn some PL/SQL. Context: Entry gets put into the Orders table. What I want to do is create a trigger( out of scope for this question) that takes the last entry's product ID number and performs a count

  • Preview corrupted

    My copy of Preview, Version 7.0 (826.4), seems to have been corrupted after a lot of hard use. Preview opens, but when I try to open a jpg file, Preview simply goes off to the spinning disk.  I have tried to replace Preview from the Time Machine copy