Moving cursor on  multi-record block with pjc components

Hi, this thread question is updated to a more specific and correct one in the new thread:
Need help on using navigation function in when-custom-item-event trigger
Please, follow there...
I have a pjc on a multi-record block. When I activate the pjc the forms cursor does not navigate to the item.
The when-custom-item-event is activated. My question is how do I move the cursor to the current record?
Best regards,
Constantin
Edited by: ConstGl on Jan 11, 2011 5:47 AM

+"... When I activate the pjc the forms cursor does not navigate to the item..."+
Sorry, but this is not clear for me.
Francois

Similar Messages

  • Fill a multi record block with a for-loop

    Hi
    I've got a simple question but I couldn't find a solution yet.
    I have a multi record block and behind this i wrote a post-query-trigger with a cursor and a for-loop. Now I try to show each record of the for-loop in the multi record block. The loop works correctly, but the problem is that I only see the last found record of the loop in the first multi record and I'm not able to go to the next multi record when the loop finds more then one record.
    I tried to use NEXT_RECORD but then I got the error message "100500: non-ORACLE exception".
    May someone help me? Thanks a lot!

    What exactly are you trying to do? If you are simply trying to display the result of a query in a Multi-Record Block (MRB), I would recommend basing your block on the query (From Clause Query) or if you are simply displaying the contents of a table or a view in the block, base your MRB on the table or view and let Forms handle displaying the records.
    The Post-Query (PQ) trigger will execute for each record displayed in the MRB, which I'm sure is not what you intended. Since the trigger fires for each record, your loop is essentially assigning the value of each row in the cursor to the same row in the MRB.
    Hope this helps.
    Craig...

  • How to do validation on multi record block at run time...

    Dear Friends,
    I have to do validation at run time on multi record block.
    If user tries to enter and save two or more records in same multi record block with same data at run time, it should not allow it and display a message like, " error : Records are having same(duplicate) values. "
    I already did validation with the data coming from database table using cursor. But confused about how to do at run time(on one screen only) ??
    Please, give details about how to check duplicate records on form block before saving it to the table ????
    Regarding details would be greatly helpful.
    thanks,

    Hi...Pankaj
    thanx for your reply..
    I already did validation for the data coming from table....
    but I need to do it on form only...at run time...
    exa...
    In one multi record block
    record no : column 1 : column 2 : column 3
    1 abc 123 hi
    2 abc 123 hi
    so it should check on the form itself, here I m not getting data from table...I am just
    navigating from first record to second using down arrow.
    so, may be 2 possibilities.
    1) when user navigates using tab to third record, it should say like two duplicate records.(may be like when validate record or item)
    2) or when user tries to save, it should say two duplicate records.
    so, everyting should take place on form screen only.....
    waiting for your reply,
    thanx...

  • Get next value in a Multi Record Block

    Hi,
    I've a Multi Record block with 2 items like below.
    pos width
    1 7
    8 5
    13 5
    18 2
    ie pos in next item is sum of pos and width of previous item.I've already implemented this.
    The problem is if the user changes width in a particular record,I want to change next records pos automatically.
    To achieve this,I wrote a when-new-record -instance-trigger as follws:
    if :system.cursor_record=1 then
    :pos:=1;
    elsif :system.record_status='changed' then
    :pos:=:pos+:width;
    end if;
    but even Though I change column width of block,:system.record_status still remain 'INSERT'.
    Pls can u pls tell me how can I acheive this?
    Prashanth Deshmukh

    You cannot use Record Status like that.
    You need to create a procedure that loops through your entire block, keeping track of the pos and width of the prior record to calculate the new pos of each record.
    Your procedure would need to do something like this:
    Declare
        v_Pos  pls_integer := 1;
    Begin
      Go_block('B1');
      First_Record;
      Loop
        Exit when :System.record_status='NEW';
        :B1.pos := v_Pos;
        v_Pos := v_Pos + :B1.width;
        Exit when :System.last_record = 'TRUE';
        Next_Record;
      End Loop;
      First_Record;
    End;

  • Multi Record Block Problem

    Hi,
    I have a multi record block with two fields NAME and DATE. On clicking the Save Button a procedure (PROC_BEFORE_SAVE) is called which loops through this block, and deletes empty records.
    PROC_BEFORE_SAVE
    LOOP
         IF :TI_NAME IS NULL THEN
              DELETE_RECORD;
         END IF;
         NEXT_RECORD;
         EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
    END LOOP;
    The proc fails and throws error (Oracle Error Unable to Update Records) only for the case that the first few records are null. Sample data given below.
    Name  -  Date
    NULL  -  NULL
    NULL  -  NULL
    NULL  -  NULL
    AJ  -  10/02/2005
    JA  -  12/12/2004
    AJV  -  12/12/2002
    This happens because it tries to update the NOT NULL field NAME as NULL.
    Could somebody please tell me why this is happening? Is there something wrong with the procedure?
    I am using Oracle Forms 6.0.8.8.0 in Windows 2000 Professional edition.
    Any help would be greatly appreciated.
    Thanks,
    Anoop

    Hi,
    Thanks for the reply. But CLEAR_RECORD also doesn't seem to work.
    Thanks,
    Anoop

  • No base table multi record block...updation

    hello all,
    i have a multi record block with two fields order & datetime to capture the time of the order. but this block is not based on any table. and i want to update another table with the datetime based on the order captured.
    how to do that...? there may be n number of records coming into the block at a time.
    thx in adv.
    Kris

    the best way is make it as a database block .and palace your insert statement in pre-insert trigger when you are inserting the record and place your update trigger in pre-update trigger u can also place your insert and update statement in back end, "i prefer the backend triggers").I think this is the best way because if you are using the go_block and next_record, that may take lots of time time to traverse record by record.
    regards
    mathew

  • Image item in multi-record block - PLEASE SOMEONE HELP !

    Hello everyone.
    I have a multi-record block with an image item that is not in teh table, is populated in the post-query trigger with a read_image_item, from a gif file. This block is child of another block. The problem is that the first records of the block, the ones that fit on the screen, are not showing the image properly, the image appears grey, distorted. In reality, the image dont adjust to the size of the item, as it is especified in the properties. When i scroll down, the rest of records show the image perfect, but this ones still are distorted.
    Forms is 6.0.8.22.1, over oracle 9i. Thank you all in advance.

    hello
    just me what is datatype of ur image record ?

  • Image item in multi-record block

    Hello everyone.
    I have a multi-record block with an image item that is not in teh table, is populated in the post-query trigger with a read_image_item, from a gif file. This block is child of another block. The problem is that the first records of the block, the ones that fit on the screen, are not showing the image properly, the image appears grey, distorted. When i scroll down, the rest of records show the image perfect, but this ones still are distorted.
    Forms is 6.0.8.22.1, over oracle 9i. Thank you all in advance.

    hello
    just me what is datatype of ur image record ?

  • Disabling a button in a multi record block

    Hi everyone,
    I have a multi record block with a button on each record, I have to be able to disable a button at runtime (following some conditions).
    the SET_ITEM_INSTANCE_PROPERTY (item, record, enabled, property_false) does not work !
    Any idea on how can I do it ?
    Thanks for any help.

    I don't think "enabled" is a valid property for SET_ITEM_INSTANCE_PROPERTY. You were probably thinking of SET_ITEM_PROPERTY but this won't work for you at the record level.
    The only thing I can think of right off hand is to set the visual attribute using SET_ITEM_INSTANCE_PROPERTY to make each button look enabled or disabled. You could define 2 visual attributes, say something like VA_BUTTON_ENABLE and VA_BUTTON_DISABLE.
    If you want the button to look enabled then:
    SET_ITEM_INSTANCE_PROPERTY(item, record, visual_attribute, 'VA_BUTTON_ENABLED'');
    If you want the button to look disabled then:
    SET_ITEM_INSTANCE_PROPERTY(item, record, visual_attribute, 'VA_BUTTON_DISABLED');
    Then, in your WHEN-BUTTON-PRESSED trigger, look at the visual attribute for that record using the GET_ITEM_INSTANCE_PROPERTY, and if the visual attribute is VA_BUTTON_ENABLED then execute your button code otherwise don't do anything.
    Give it a try and see if that works for you.
    Hope it helps.
    Travis

  • Get the first item value of previous record in a multi record block

    Hai,
    I have a multi record block with four items.I should get the first item value of the previous record so that I can increment its value in the current record.
    Thanks.........

    If you want a distinct value in each row or to be able to retrieve the records in the same order they were written then you should use a sequence.
    If you want to retrieve the records in the same order they were created in the block then you will need a diffferent solution to the one you outline here since a user could enter a new record between two others.
    I posted this a while back in response to someone who was using a sort_key item and resetting it for each row when a new record was inserted:
    If you make the sort_key bigger then you have much more room to insert new rows in between existing rows without having to reset all the sort_keys.
    Eg. you have rows with sort_keys of 129282000000000000 and 129283000000000000 (you can have more zeros if you want) and you want to insert a row in between. if you're using oracle forms then the user would have to click on the first of these rows and then do 'insert'. in your insert process you would store the sort keys of the current record and the one below, create a blank record in between and set the sort_key of that record to the average of the other two. you will be able to insert many new rows in between the original 2 before running out of space in the sort_key field.
    the method above is not sufficient, there are some other cases to consider:
    1) when the user is on the last record of the block then you will just create a new record with sort_key set to a greater number than the row before. you can have the sort_key defined as number(38) and to safely allow you to enter 1000 rows each new row would normally be 10E33 greater than the previous one.
    2) when the user is entering the first record then just set the sort_key to 10E33.
    3) on the off-chance that you do insert a great number of records and cannot insert another in between then you would need to alert the user, process the records so that the sort_keys are evenly spaced and requery the block. this processing could be scheduled nightly to make this eventuality even less likely.
    4) make sure the user cannot run the default 'clear_record' procedure. this would break my method as well as yours!
    James.

  • Cursor Jumping to last record when query mode for Multi-record block.

    I have a multi-record block. the seq field has this validation to check that there should not be a gap
    in sequence for S_type and cer_dl field.The program unit is as below.
    PROCEDURE seq_validation IS
    --Validation to check that there is no gaps in sequence for S_TYPE and cer_dl fields
    l_value_to_check varchar2(100);
    l_seq_found number;
    l_curr_sequence number;
    l_new_value varchar2(100);
    l_found boolean:=FALSE;
    l_new_set boolean := FALSE; --s_type and cer_dl are different from previous set.
    begin
    if trim(:b1.s_type) is not null
    or trim(:b1.cer_dl) is not null
    then
    -- Program continues here only if all the items are not null
    -- Get information from record that needs to be validated
    l_value_to_check := trim(:b1.s_type) || ':'|| trim(:b1.cer_dl) ;
    l_curr_sequence := :sequence;
    if :SYSTEM.CURSOR_RECORD = '1' then
    ---to check sequence is entered as 1 in the first record
    message('Error:Sequence should start with 1');
    raise form_trigger_failure;
    end if;
    go_item('b1.XYZ');
    else
    FIRST_RECORD;
    while :SYSTEM.LAST_RECORD != 'TRUE'
    loop
    l_found := FALSE;
    l_new_value := trim(:b1.S_type) || ':'|| trim(:cer_dl) ;
    if l_new_value = l_value_to_check then --
    l_new_set:= FALSE;
    l_seq_found := :seq;
    if l_seq_found >= l_curr_sequence then
    go_item('b1.seq');
    l_new_set := FALSE;
    elsif l_seq_found < l_curr_sequence - 1 then
    go_item('b1.sequence');
    l_found := FALSE;
    elsif l_seq_found = l_curr_sequence - 1 then
    l_found:= TRUE;
    go_item('b1.xyz); --go to next item
    end if;
    else
    l_new_set := TRUE;
    end if;
    NEXT_RECORD;
    end loop;
    if l_new_set then
    go_item('b1.xyz'); -- go to next item
    else
    if not l_found then
    message('Error:Sequence should be in order.');
    go_item('b1.seq');
    raise form_trigger_failure;
    end if;
    end if;
    go_item('b1.xyz'); ---go to next item
    end if;
    end if;
    end;     
    In the insert mode its working fine(unless you gurus feel to change to make it more perfect.
    When I say enter-query and put 'IAS' in the s_type field and then do a execute query it brings all the records of 'IAS'.
    Now as I want to update the records, and when I navigate across field(s_type,cer_dl,Seq,xyz) using tab and move the cursor down on second
    record(IAS N 2 N), what happens is when I navigate to sequence field the cursor jumps to LAST RECORD( IAS Y 3 N ) of LAST field XYZ.
    I am putting the sample record
    s_type cer_dl seq xyz
    IAS N 1 N
    IAS N 2 N
    IAS N 3 N
    IAS N 4 N
    IAS Y 1 N
    IAS Y 2 N
    IAS Y 3 N
    The cursor moves to last record --IAS -Y -3-N when I tab across the second record.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    When I say enter-query and put 'IAS' in the s_type field...For your validation to work you must not allow users to enter records in the middle of a block, clear records from the block or query specific records. If you allow the users to enter a query then you are allowing 2 of the rules to be broken.

  • How to call a report with a bind variable from a multi-record block

    Hi,
    I have created a report using the BI Publisher functionality. I did all the integration, created the SQL Query and uploaded the template. Up till here everythings fine!
    My SQL Query has 2 bind variables.
    I will call my report from a multi record block, at the end of each record an icon is shown which the user can click to open the report.
    I created a column link for this item (PRINT_REPORT=Inschrijvingsformulier) but I do not manage to pass the parameters to my report. The parameters I want to pass are 2 columns in this Multi Record block.
    I created 2 hidden fields on the page P9_PARAMETER1, P9_PARAMETER2 with the same names as my bind variables and fill this in with the values #PARAMETER1#, #PARAMETER2# from the multi record block.
    It seems it does not work as my report stays empty. (also XML file stays empty).
    Am I trying the wrong way?
    Thanks for any advice,
    Kris

    hi khadeer,
         create one report program and write the required code,and call this function module 'SSF_FUNCTION_MODULE_NAME' and give your smartform name  and also when u activate ur smart form u will get one function module call that function module also and specify any tables used...
    i think this solves ur problem...
    any queries revert back..
    pls reward points if helpful,
    shylaja

  • Setting FORMAT_MASK in a multi-record block using a PJC

    Hello,
    We have a requirement to apply different format masks to different records in a multi-record block. I'm investigating using a PJC to do this, but without any decent documentation of the VTextField class, I'm struggling a little to figure out what method(s) to call.
    setDisplayStringFilter() sounds promising, it seems to take a DisplayStringFilter object as its argument, but beyond that, I'm lost... Has anyone done anything similar?
    Cheers,
    James

    Assuming you can find the right method you still have a problem. The second argument in the set_custom_property procedure relates to the row within the block, not the the row within the resultset. So when someone moves the scrollbar you'll have to have each instance of the pjc change its format mask to whatever is appropriate for the new data. The pjc will have to be able to listen for changes to the data in the columns which determine what the format mask should be.
    Perhaps you could use a text item and set the format in post-query/when-validate.

  • Check box in a multi record block

    I have a multi record block that has a check box. I need to be able to go to the first record on the block, go through each row and check to see if it's selected. I will then get all the rows that were selected and passed it as a parameter in a package.I have already declared a global variable in the package to get all the rows selected.
    Can anyone please help.

    Hi
    This is my solution for your problem. If I understand correctly as you have to post the selected records from form to journal entry (a server operation). What you need to do is in your Oracle Forms multi record block construct a loop which goes from first record to last record of your data block, capture the selected records (wherever the check box is CHECKED ON) into a PL/SQL table structure (PL/SQL table is quite simillar to Oracle Forms RECORD GROUP structure, but more versatile as it can be recognized on the back end too).
    Once you populate the PL/SQL table with the selected record, pass the PL/SQL table itself as parameter to your package.
    Open the PL/SQL table in your destination code and do further processing with those selected records !!
    Hope this will work !!
    MOHAMMED R.QURASHI
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by kay:
    I CANNOT USE A RECORD GROUP. I HAVE TO EVENTUALLY POST THE SELECTED ROWS INTO JOURNAL ENTRIES. I STILL NEED TO BE ABLE TO
    GET ALL THE ROWS SELECTED BY THE USER.CAN I USE A CURSOR IN THE FORM TO GET ALL THE ROWS
    SELECTED?.
    THANKS FOR THE REPLY GANESAN.<HR></BLOCKQUOTE>
    null

  • FETCHING VALUES IN MULTI RECORD BLOCK FROM ANOTHER TABLE USING SELECT STATEMENT.

    Hi,
    I have one multi record block in which i want to fetch values
    (more then one record) from another table using select statement
    IN KEY NEXT ITEM.I am getting following error.
    ORA-01422: exact fetch returns more than requested number of rows
    Thanks in advance.

    In your case I see no reason to use non-database block and to try to populate it from a trigger with a query, instead of using the default forms functionality where you can associate the block and the fields with table, create where clause using bind variables and simply use execute_query() build-in to populate the block. The power of the forms is to use their build-in functionality to interact with the database.
    Also, you can base your block on a query, not on a table and you dynamically change this query using set_block_property() build-in. You can use any dynamic queries (based on different data sources) and you simply need to control the column's data type, the number of the columns and their aliases. Something like creating inline views as a block data source.
    However, you can replace the explicit cursor with implicit one like
    go_block('non_db_block_name');
    first_record();
    FOR v_tab IN (SELECT *
    FROM tab
    WHERE col_name = :variable)
    LOOP
    :non_db_block_name.field1 := v_tab.col1;
    :non_db_block_name.field2 := v_tab.col2;
    next_record();
    END LOOP;

Maybe you are looking for