This discussion is archived
1 2 Previous Next 18 Replies Latest reply: Jan 25, 2013 1:53 AM by 967903 Go to original post RSS
  • 15. Re: error unable to resolve reference to items.
    yoonas Expert
    Currently Being Moderated
    I am sorry, When you say item are you meaning a value saved in the table column?

    I was referring to block items , not the values from a column.

    I am sorry, not able to understand your requirment exactly, can you tell what you are trying to achive
  • 16. Re: error unable to resolve reference to items.
    967903 Newbie
    Currently Being Moderated
    suppose item XXX have various transaction in table column

    now we fetch these items in block .XXX comes in block in various places.now i have to search XXX in which place it is in block.

    suppose XXX comes in 1st,5th,23th and 92th row in block.

    then first time when i search XXX then cursor firstly goes to 1st row and after this when i press enter button on first row then cursor will go to 5th row.next time 23th row and finally at 92 th row and after this if XXX is not in list then exit;

    that is what i actualy want to do.

    Thanks
    Ravi
  • 17. Re: error unable to resolve reference to items.
    yoonas Expert
    Currently Being Moderated
    DECLARE
    temp_last number(2);
    item varchar2(30);
    chk_exc exception;
    i number(2);
    j number(2);
    result number;
    
    BEGIN
    go_block('BLOCK3');
    last_record;
    temp_last:=to_number(:system.cursor_record);
    for i in 1..temp_last 
    loop
    go_record(i);
    item:=:BLOCK3.item; 
    if ITEM=:BLOCK1.SEARCH_PART
    THEN
    /* using alert
    --create alert alert_1 with two buttons
    result:=show_alert('alert_1');
    if result=alert_button2 then
    
              exit;
    end if;
    -- using alert*/
    
    --this will high light the record
    --create a visual attribute with va_1 name
    set_item_instance_property('block3.item',current_record,visual_attribute,'va_1');
    
    end if;
    end loop;
    exception
    when chk_exc then
    message(' Not Exist !');
    Raise form_trigger_failure;
    END; 
    A few suggestions, see if you can use this way

    1. After search is started and item is found it gives an alert saying found a match and if user says yes it will continue else it will just exit(you will have to create an alert)


    2. You can loop through all records and high all the matched items

    3. If you want the way you said start with search button then you can code in your item's key-next-item trigger. Each time enter key is pressed you just have to start from the current record you don't have to start from first record.

    I have modified your code, you can try above code. code with alert once is commented so make sure if you want to test that to remove the comment.
  • 18. Re: error unable to resolve reference to items.
    967903 Newbie
    Currently Being Moderated
    thanks a lot.now problem is resolved.



    Thanks
    Ravi
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points