Cursor should be placed in Current Record.

Hi All,
I have a form,if in tabular form.
For Exp : if the user have done change in the 2nd record and click on save button.The cursor is going to the 1st record automatically.
After save also change also the cursor should be in the same changes record.
Can any help me in this issue...
Regards
Siva

Hi again
i have a code , but i am not sure if its the most perfet solution for your problem
the code should be in KEY_Commit trigger or on on_commit as follows :
---===================================================
Declare
     V_REC_NO number ;
Begin
     v_rec_no := :System.Cursor_Record ;
     --any code you need to do on commiting
     Commit ;
     go_record ( v_rec_no ) ;
End ;
-====================================================
Thank you

Similar Messages

  • How to Highlight the CURRENT RECORD in a Table with Report Form

    Hi,
    I have created a Table with Report Form....let suppose the table is - EMP
    Report page - 1
    Form page - 2
    Now, when I do Create / Update on Page 2,....the control is back on Page1.
    Suppose in the Report Page (Page1)..we have 10 records....NOW how should I highlight the CURRENT RECORD in Page 1 with some color to identify the record which I have updated/created just now...
    Thanks,
    Deepak

    Hi Deepak,
    You could do that with a custom report template. I've done that here: [http://apex.oracle.com/pls/otn/f?p=267:175]
    Go to Shared Components, Templates and create a new Report template as a copy of your existing one. Then edit your template. In the above example, the Column Template 1 setting was:
    <td #ALIGNMENT# headers="#COLUMN_HEADER#" class="t18data">#COLUMN_VALUE#</td>I copied this into the Column Template 2 setting and updated the Column Template 1 setting to:
    <td #ALIGNMENT# headers="#COLUMN_HEADER#" class="t18data" style="background-color:red; color:yellow;">#COLUMN_VALUE#</td>I then set the Column Template 1 Condition to: Use Based on PL/SQL Expression
    and the Column Template 1 Expression to: '#EMPNO#' = '&P178_EMPNO.'
    (In my example, P178_EMPNO is the single item on the linked to page.
    Save those changes and go to your report and change its template to the new one. As long as a selection has been made and P178_EMPNO has a value, the condition will make sure that the report uses the first template for the row with the matching EMPNO value. All other rows get the template from Column Template 2.
    Andy

  • Cursor should be at Current checkbox

    Hi All,
    I have written the coding.If i check the record,and do some calculations affter click on Pre-Calculate Button again the cursor is going to 1st record.
    plss can any one help me in this issue..
    In WHEN_BUTTON_PRESSED trigger i have written the coding
         DECLARE     
                        CURRENTRECORD NUMBER;
    begin
         /* HERE IS THE CODE FOR DISCOUNT RATE IF THE USER CHECKS ALL FOR SELECT FOR DISCOUNT RATE AS WELL AS DISCOUNT REASON */
    BEGIN
              DECLARE
                   CURRENT_DISCOUNT NUMBER;
                   CURRENT_REASON VARCHAR2(100);     
              BEGIN
                   CURRENT_DISCOUNT:=:XXSY_DISCOUNT_MANAGER_V.DISCOUNT_RATE ;
                   CURRENT_REASON:=:XXSY_DISCOUNT_MANAGER_V.DISCOUNT_REASON;
                   CURRENTRECORD :=:SYSTEM.CURSOR_RECORD;
                   FND_MESSAGE.SET_STRING(CURRENTRECORD);
                   FND_MESSAGE.SHOW;
                   IF :XXSY_DISCOUNT_MANAGER_V.SELECT='Y' THEN
    --               go_block('XXSY_DISCOUNT_MANAGER_V');
                   FIRST_RECORD;
                   WHILE TRUE LOOP
                   :XXSY_DISCOUNT_MANAGER_V.DISCOUNT_RATE:= CURRENT_DISCOUNT;
                   :XXSY_DISCOUNT_MANAGER_V.DISCOUNT_REASON:= CURRENT_REASON;
                        NEXT_RECORD;
                             IF :System.Last_Record = 'TRUE' THEN                    
                             :XXSY_DISCOUNT_MANAGER_V.DISCOUNT_RATE:=CURRENT_DISCOUNT;
                             :XXSY_DISCOUNT_MANAGER_V.DISCOUNT_REASON:=CURRENT_REASON;
                        exit;
                             END IF;     
                   END LOOP;
                   END IF;
    --               go_block('XXSY_DISCOUNT_MANAGER_V');
                   FIRST_RECORD;
                   WHILE TRUE LOOP
                        if :XXSY_DISCOUNT_MANAGER_V.DISCOUNT='Y' THEN
                   :XXSY_DISCOUNT_MANAGER_V.DISCOUNT_RATE:= CURRENT_DISCOUNT;
                   :XXSY_DISCOUNT_MANAGER_V.DISCOUNT_REASON:= CURRENT_REASON;
                        end if;
                                  NEXT_RECORD;
                        IF :System.Last_Record = 'TRUE' AND :XXSY_DISCOUNT_MANAGER_V.DISCOUNT='Y' THEN                    
                        :XXSY_DISCOUNT_MANAGER_V.DISCOUNT_RATE:=CURRENT_DISCOUNT;
                        :XXSY_DISCOUNT_MANAGER_V.DISCOUNT_REASON:=CURRENT_REASON;
                   exit;
                        ELSE if :System.Last_Record = 'TRUE' and :XXSY_DISCOUNT_MANAGER_V.DISCOUNT <>'Y' then
                             exit;
    end if;
                        END IF;
                   END LOOP;
                   END;               
    END;
    --     go_block('XXSY_DISCOUNT_MANAGER_V');
         FIRST_RECORD;
         WHILE TRUE LOOP
         if :XXSY_DISCOUNT_MANAGER_V.DISCOUNT = 'Y' AND :XXSY_DISCOUNT_MANAGER_V.NO_CHARGE_FLAG ='N' then
                        :XXSY_DISCOUNT_MANAGER_V.OVERRIDE_UNIT_PRICE:=round((((100-:XXSY_DISCOUNT_MANAGER_V.DISCOUNT_RATE)/100)*:XXSY_DISCOUNT_MANAGER_V.LIST_PRICE),2);
                        :XXSY_DISCOUNT_MANAGER_V.EXTENDED_PRICE := round((:XXSY_DISCOUNT_MANAGER_V.OVERRIDE_UNIT_PRICE)*(:XXSY_DISCOUNT_MANAGER_V.QUANTITY),2);
                        :XXSY_DISCOUNT_MANAGER_V.NET_PRICE := :XXSY_DISCOUNT_MANAGER_V.EXTENDED_PRICE;
              END IF;     
                   NEXT_RECORD;
              IF :System.Last_Record = 'TRUE' THEN
    if :XXSY_DISCOUNT_MANAGER_V.DISCOUNT = 'Y' AND :XXSY_DISCOUNT_MANAGER_V.NO_CHARGE_FLAG ='N' then     
                   :XXSY_DISCOUNT_MANAGER_V.OVERRIDE_UNIT_PRICE:=round((((100-:XXSY_DISCOUNT_MANAGER_V.DISCOUNT_RATE)/100)*:XXSY_DISCOUNT_MANAGER_V.LIST_PRICE),2);
                        :XXSY_DISCOUNT_MANAGER_V.EXTENDED_PRICE := round((:XXSY_DISCOUNT_MANAGER_V.OVERRIDE_UNIT_PRICE)*(:XXSY_DISCOUNT_MANAGER_V.QUANTITY),2);
                        :XXSY_DISCOUNT_MANAGER_V.NET_PRICE := :XXSY_DISCOUNT_MANAGER_V.EXTENDED_PRICE;
              END IF;
              exit;
              END IF;
         END LOOP;
                   FND_MESSAGE.SET_STRING(CURRENTRECORD);
                   FND_MESSAGE.SHOW;               
    go_record(CURRENT_RECORD);
    end;
    Pls check and pls let me know.
    Even i have given display message it is displying the record ,but again itis giong to 1st record.
    pls help me
    Regards
    Prasad.

    hi
    Try this before get the current record number :
    GO_BLOCK( 'XXSY_DISCOUNT_MANAGER_V') ;
    CURRENTRECORD :=:SYSTEM.CURSOR_RECORD ;
    then your code and maybe u have to back to the previouse record to not break your calculation
    Finally at the end of trigger
    GO_BLOCK( 'XXSY_DISCOUNT_MANAGER_V') ;
    go_record(CURRENT_RECORD);
    end ;

  • HOW TO COPY THE PREVIOUS RECORD TO THE CURRENT RECORD

    Hi all,
    i am using form 6i.
    i have one multi record block. the user has to enter all the values and store it to the table.
    My requirement is - if user is in some blank record, if user clicks the button then all the previous record values should be coppied to the record where the user has placed the cursor.
    please help me..
    Thanks..

    user13329002 wrote:
    Except these columns all other columns should be copied when i press the button.So? Use duplicate_record and set the columns you don't want to copy to null or a value you want?
    duplicate_record;
    :my_block.creation_date := sysdate;
    :my_block.modiefied_date := null;cheers

  • Get three previous records of the current record

    Hi,
    I need to get three previous records of the current record in an Oracle Form
    Sorry for the lengthy explanation:
    I have a table name: ARCHIVE_DATA with column name: coll_time and its data type DATE.
    SQL> SELECT COLL_TIME FROM ARCHIVE_DATA;
    COLL_TIME
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    10 rows selected.
    SQL> select to_char(coll_time,'dd-mon-yyyy:HH:MI:SS') from ARCHIVE_DATA;
    TO_CHAR(COLL_TIME)
    12-aug-2005:02:42:00
    12-aug-2005:02:43:00
    12-aug-2005:02:44:00
    12-aug-2005:02:45:00
    12-aug-2005:02:46:00
    12-aug-2005:02:47:00
    12-aug-2005:02:48:00
    12-aug-2005:02:49:00
    12-aug-2005:02:50:00
    12-aug-2005:02:51:00
    10 rows selected.
    This is the Requirement:
    In a Form's Block(BLK1), for example: the current_record is the fifth record from the top
    (i.e. 12-aug-2005:02:46:00)
    When the fifth record is the current_record and When I click a button, three previous records of the
    current_record should be populated on the screen.
    See what I did:
    I created another table same as the first table(ARCHIVE_DATA) and its name is: THREE_RECS.
    I am inserting three records from the first table(ARCHIVE_DATA) into the second table: THREE_RECS
    which are less than the current record and ORDER BY DESC.
    CANVAS:
    Two blocks (BLK1, BLK2) based on ARCHIVE_DATA and THREE_RECS are on the same CANVAS.
    But the first block (BLK1) which is based on the first table:ARCHIVE_DATA is populated with one record and the
    second block (BLK2) is empty.
    So when I click a particular button (ex: prev_recs), the second block(BLK2) should be populated with
    three previous records of the current record( :BLK1.COLL_TIME)
    (off course :BLK2 populates with one record and use arrows or scrollbar to get the other two records)
    This is the code I wrote in the trigger and followed by the error:
    1 BEGIN
    2 DECLARE
    3 cursor c1 IS
    4           SELECT MONITOR_ID,
    5               SAMPLE_ID,
    6               COLL_TIME,
    7               DEW_POINT
    8          FROM ARCHIVE_DATA;
    9 cursor c2(passing_date IN date) IS
    10           SELECT MONITOR_ID,
    11               SAMPLE_ID,
    12               COLL_TIME,
    13               DEW_POINT
    14          FROM (SELECT MONITOR_ID,
    15               SAMPLE_ID,
    16               COLL_TIME,
    17               DEW_POINT
    18          FROM ARCHIVE_DATA
    19          ORDER BY COLL_TIME desc)
    20      WHERE COLL_TIME < passing_date;
    21     BEGIN
    22     FOR cur_rec in c1
    23     LOOP
    24          IF (cur_rec.COLL_TIME = to_date(:BLK.COLL_TIME,'dd-mon-yyyy:HH24:mi:ss')) then
    25     FOR second_cur_rec in c2(second_cur_rec.COLL_TIME)
    26          LOOP
    27      IF c2%rowcount < 4 then
    28               BEGIN
    29               INSERT INTO THREE_RECS
    30                    values(second_cur_rec.MONITOR_ID,
    31                         second_cur_rec.SAMPLE_ID,
    32                         second_cur_rec.COLL_TIME,
    33                         second_cur_rec.DEW_POINT);
    34               COMMIT;
    35               END IF;
    36 END LOOP;
    37 END IF;
    38 END LOOP;
    39 END;
    40 END;
    This is the error I am getting:
    Error 103 at line 14
    Encountered the symbol "(" when expecting one of the following
    a PL/SQL variable or double quoted string
    an expanded name
    an expanded name link
    a table reference __expression
    a key word
    Resuming parse at line 126, column 46
    Thanks in advance

    Why not just a simple select that doesn't involve a second table and PL/SQL?
    sql>select * from t1 order by dt;
    DT
    08/12/2005 02:42:00am
    08/12/2005 02:43:00am
    08/12/2005 02:44:00am
    08/12/2005 02:45:00am
    08/12/2005 02:46:00am
    08/12/2005 02:47:00am
    08/12/2005 02:48:00am
    08/12/2005 02:49:00am
    08/12/2005 02:50:00am
    08/12/2005 02:51:00am
    10 rows selected.
    sql>select dt
      2    from (select dt, row_number() over (order by dt desc) rn
      3            from t1
      4           where dt < to_date('12-aug-2005:02:46:00', 'dd-mon-yyyy:hh:mi:ss'))
      5   where rn <= 3
      6   order by dt;
    DT
    08/12/2005 02:43:00am
    08/12/2005 02:44:00am
    08/12/2005 02:45:00am
    3 rows selected.If the use of an analytical function (row_number()) is a problem with Forms, then the query can also be done as:
    sql>select dt
      2    from (select dt
      3            from (select dt
      4                    from t1
      5                   where dt < to_date('12-aug-2005:02:46:00', 'dd-mon-yyyy:hh:mi:ss')
      6                   order by dt desc)
      7           where rownum <= 3)
      8   order by dt;
    DT
    08/12/2005 02:43:00am
    08/12/2005 02:44:00am
    08/12/2005 02:45:00am
    3 rows selected.

  • Get three previous records of the current record in an Oracle Form

    Hi,
    I need to get three previous records of the current record in an Oracle Form
    Sorry for the lengthy explanation:
    I have a table name: ARCHIVE_DATA with column name: coll_time and its data type DATE.
    SQL> SELECT COLL_TIME FROM ARCHIVE_DATA;
    COLL_TIME
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    10 rows selected.
    SQL> select to_char(coll_time,'dd-mon-yyyy:HH:MI:SS') from ARCHIVE_DATA;
    TO_CHAR(COLL_TIME)
    12-aug-2005:02:42:00
    12-aug-2005:02:43:00
    12-aug-2005:02:44:00
    12-aug-2005:02:45:00
    12-aug-2005:02:46:00
    12-aug-2005:02:47:00
    12-aug-2005:02:48:00
    12-aug-2005:02:49:00
    12-aug-2005:02:50:00
    12-aug-2005:02:51:00
    10 rows selected.
    This is the Requirement:
    In a Form's Block(BLK1), for example: the current_record is the fifth record from the top
    (i.e. 12-aug-2005:02:46:00)
    When the fifth record is the current_record and When I click a button, three previous records of the
    current_record should be populated on the screen.
    See what I did:
    I created another table same as the first table(ARCHIVE_DATA) and its name is: THREE_RECS.
    I am inserting three records from the first table(ARCHIVE_DATA) into the second table: THREE_RECS
    which are less than the current record and ORDER BY DESC.
    CANVAS:
    Two blocks (BLK1, BLK2) based on ARCHIVE_DATA and THREE_RECS are on the same CANVAS.
    But the first block (BLK1) which is based on the first table:ARCHIVE_DATA is populated with one record and the
    second block (BLK2) is empty.
    So when I click a particular button (ex: prev_recs), the second block(BLK2) should be populated with
    three previous records of the current record( :BLK1.COLL_TIME)
    (off course :BLK2 populates with one record and use arrows or scrollbar to get the other two records)
    This is the code I wrote in the trigger and followed by the error:
    1 BEGIN
    2 DECLARE
    3 cursor c1 IS
    4           SELECT MONITOR_ID,
    5               SAMPLE_ID,
    6               COLL_TIME,
    7               DEW_POINT
    8          FROM ARCHIVE_DATA;
    9 cursor c2(passing_date IN date) IS
    10           SELECT MONITOR_ID,
    11               SAMPLE_ID,
    12               COLL_TIME,
    13               DEW_POINT
    14          FROM (SELECT MONITOR_ID,
    15               SAMPLE_ID,
    16               COLL_TIME,
    17               DEW_POINT
    18          FROM ARCHIVE_DATA
    19          ORDER BY COLL_TIME desc)
    20      WHERE COLL_TIME < passing_date;
    21     BEGIN
    22     FOR cur_rec in c1
    23     LOOP
    24          IF (cur_rec.COLL_TIME = to_date(:BLK.COLL_TIME,'dd-mon-yyyy:HH24:mi:ss')) then
    25     FOR second_cur_rec in c2(second_cur_rec.COLL_TIME)
    26          LOOP
    27      IF c2%rowcount < 4 then
    28               BEGIN
    29               INSERT INTO THREE_RECS
    30                    values(second_cur_rec.MONITOR_ID,
    31                         second_cur_rec.SAMPLE_ID,
    32                         second_cur_rec.COLL_TIME,
    33                         second_cur_rec.DEW_POINT);
    34               COMMIT;
    35               END IF;
    36 END LOOP;
    37 END IF;
    38 END LOOP;
    39 END;
    40 END;
    This is the error I am getting:
    Error 103 at line 14
    Encountered the symbol "(" when expecting one of the following
    a PL/SQL variable or double quoted string
    an expanded name
    an expanded name link
    a table reference __expression
    a key word
    Resuming parse at line 126, column 46
    Thanks in advance

    Change C2 to:
    cursor c2(passing_date IN date) IS
      SELECT MONITOR_ID, SAMPLE_ID,
                   COLL_TIME, DEW_POINT
        FROM ARCHIVE_DATA
        WHERE COLL_TIME < passing_date
        ORDER BY COLL_TIME desc;And rather than populating a table with the three records, you could just select the three records using: where COLL_TIME between Prev3_time and Prev1_time

  • Enable Field on current record

    Hi i have multi data block filed. and checkbox field which based on control block
    My task is when i check checkbox only one field should enabled and my mouse goes to that field
    e.g
    item11 item21 item31 chkbox1
    item12 item22 item32 chkbox2
    Scenario like this :
    My item field based on data block and checkbox based on control block,
    while i checked chkbox1 , only item31 on that current record should be enabled and i changed value only on that field
    second scenario is when i checked chkbox1 , my cursor goes to item31...not item32

    Hello,
    use THE following :
    IF : chkbox1 = 1  -- CHECKED THEN
    SET_ITEM_PROPERTY ( 'item3',ENABLED ,PROPERTY_TRUE);
    SET_ITEM_PROPERTY ( 'item3',NAVIGABLE,PROPERTY_TRUE);-- and set other items as
    ELSE
    SET_ITEM_PROPERTY ( 'item21' ,ENABLED ,PROPERTY_FALSE);
    SET_ITEM_PROPERTY ( 'item21' ,NAVIGABLE,PROPERTY_FALSE);and u have 2 set the focus of the cursor to a navigable enable item..
    -- AS
    GO_ITEM ( 'item3');
    this is affecting a whole record or block's behaviour
    but better use SET_ITEM_INSTANCE_PROPERTY for a given item as Ahmed Mentioned
    Hope this solve ur problem,
    Regards,
    Abdetu..
    Edited by: Abdetu on Nov 19, 2010 10:52 PM

  • Disable a current record....

    How to disable a current record in tabular?
    My tabular contain 5 records. if my cursor in first record, i want to do some calculation and disable it(current record) but other text fields(4 records) should be in enable mode.
    i used set_item_property it disable all records...
    How to do this?
    Thanks..
    Edited by: skud on Jul 15, 2011 6:36 PM

    Use set_item_instance_property instead of set_item_property and disable insert and update allowed property of all block's items e.g.
    if :system.cursor_record='1' then
    set_item_instance_property('TEXT_ITEM1', current_record, insert_allowed, property_off);
    set_item_instance_property('TEXT_ITEM1', current_record, update_allowed, property_off);
    set_item_instance_property('TEXT_ITEM1', current_record, NAVIGABLE, property_off);
    end if;

  • Current Record

    Please help, I can't find the answer to this:
    How do I get from qView to setting the current record. I can already generate the keys and pass them. I just need to be able to set the current record from the qView variable.
    Thanks,
    aaron

    // Here's where you get the Key Table from the session. (keyTable is a member of your Object) This could be placed within internalInitialize of a DataWebBeanImpl...
    if ((keyTable = (Hashtable)session.getAttribute("KeyTable")) == null)
    keyTable = new Hashtable();
    session.setAttribute("KeyTable");
    // Here's how you could store the all keys of a RowSet within the table....
    Row tmp = qView.getCurrentRow(); // backup
    Row row = qView.reset();
    while (qView.hasNext())
    row = qView.next();
    keyTable.put(row.toString(), row.getKey());
    if (tmp != null)
    qView.setCurrentRow(tmp); // return to backup
    // After fetching the KeyTable you can then check to see if the Key exists for the RowKey you've passed.
    String keyId = (String)request.getParameter("RowKey");
    Key key;
    if ((key = (Key)keyTable.get(keyId)) != null)
    // set current row using key as before.
    }That should work for you. Note I used the "Row.toString()" method instead of "Key.toString()" as the key. I found that the Key.toString() method returns a very large String, while Row returns a RowSet unique identifier for the Row that is much smaller. (this appears to work with no problem for me!)
    Also note I used Session.set(get)Attribute (from the Servlet 2.2 spec) instead of Session.set(get)Value.
    I hope that helps you accomplish what you were trying for!
    Jim

  • No field in current record - message

    Access2007.accd of an old db built circa 90s .mdb; 
    Main form, with single form Sub form2, with continuous Sub form3
    Main form has a Combobox1 to select record from Table 1
    Sub form2 has a Combobox2 in its header to select record from Table 2 (Many to Table 1 key)
    Combobox2's record set is a query with criteria of Main form Key ID so it only displays choices valid to Main form 
    continuous Sub form3 displays records from Table 3 (Many to Table 2 key)
    and this all works fine
    when Main form's combobox1 is changed, subform 2 is requeried and combobox 2 requires an explicit requery in the combobox 1 AfterUpdate Event
    this also works fine - except - if one has highlighted a row in continuous sub form 3, and then using your cursor to go to Main form combobox 1 and select ; then the error message 'No combobox2 is in the current record' appears
    so I am guessing the 'current record' is the issue but not sure how to resolve.......

    All that I can add to this is:
    clicking in a row/field in continuous sub form 3 causes the problem as per the first post
    if one clicks into single Sub Form 2 before triggering the Main combo box - everything works ok
    because the error is saying 'there is no such field in the current record'....and the Go To step of the macro is to a control and not a field - it is a baffling error to me.  But to satisfy this insanity I created a calculated field in the query record
    source of continuous sub form 3 using the name of the control and just entering a fixed 'dummy' value....
    and that works.... a bizarre work around.......

  • Moving to current record after execute query

    Hi all,
    I have a form where i can list all db jobs which can be start or stop.
    for more details, form is having columns like jobs, current db status, action(start/stop drop down)
    The user will view list of jobs in the screen and he straightly goes to a record and start (submit) the job using drop down for that record.
    once they start/stop the job, execute query will fire to show the current status of the job.
    Now going to my requirement,after execute query, I want to go to the record (job) which user has started the job .
    Currently the cursor will go to first record.
    Is there any oracle 10g AS property where i can get current record , put it in parameter and go to that record after execute query?
    Is there any other way?
    Regards,
    Leonard

    Hello,
    If you are sure the record after query will keep the same position, you can before, store the current record in a number variable with Get_Block_Property( CURRENT_RECORD) built-in, then after query use the Go_Record() with stored number variable in parameter.
    If you think that after re-query the record number can change, you have to loop through your records, then stop navidation while you find the corresponding key.
    Francois

  • Current record issue

    Hi,
    I have a data block in tabular format, displaying 10 records at a time with a scrollbar. There is a checkbox for each record. When the checkbox is checked/unchecked, I have to populate a summary field by looping through all the records including/excluding the record which was checked/unchecked. After this is done, I want the cursor to remain in the same record. Since i am using NEXT_RECORD to loop through all the records, the cursor comes to the last record. Then i used CURRENT_RECORD property to store the current record value and I reset the property after the looping is done. Now the cursor remains in the same record, but that record becomes the first record in the canvas meaning that the record scrolls upwards. How can we avoid this ? I want the canvas to remain in the same position as it was before checking/unchecking.
    Regards,
    Suresh

    First of all, you don't have to loop over a block to sum something. That's what calculated items are for. Create a calulated item of type formula with something like the following as formula
    CASE WHEN :BLOCK.CHECKBOX='J' THEN :BLOCK.VALUE ELSE 0 ENDCreate another calculated item of type summary which sums up the formerly created item.
    If you still want to loop:
    -Remember SYSTEM.CURSOR_ITEM before starting
    -Remember GET_BLOCK_PROPERTY('BLOCK', TOPMOST_RECORD)
    -After finished, do a GO_RECORD(<theFormelryRememberedSYSTEM.CURSOR_ITEM);
    -Loop as long as GET_BLOCK_PROPERTY('BLOCK', TOPMOST_RECORD) is smaller then the remembered value and do a NEXT_RECORD;

  • Keeping current record after refreshing iterator (iterator refresh)

    Greetings,
    I'm using the following code to refresh a master iterator, so that when data is saved\edited it is automatically refreshed in the user interface. I'm using BC for the model layer.
    public String commandButton_save_action() {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding =
    bindings.getOperationBinding("Commit");
    OperationBinding operationBinding2 =
    bindings.getOperationBinding("Execute");
    System.out.println("Now @ Global bean ... going to ...");
    operationBinding.execute();
    operationBinding2.execute();
    // It should be a error page
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    // Refresh main view object
    DCBindingContainer bc =
    (DCBindingContainer)FacesContext.getCurrentInstance().getExternalContext().getRe
    questMap().get("bindings");
    FirstCareAppModuleImpl fc =
    (FirstCareAppModuleImpl)bc.findDataControl("FirstCareAppModuleDataControl").getD
    ataProvider();
    ViewObject vo_SitSocProf = fc.findViewObject("EpisodiosMain");
    vo_SitSocProf.executeQuery();
    System.out.println(" All done. Ciao ");
    return "back";
    I just want to refresh data from database and still show the current record. This is always taking me to the first record in the iterator.
    The issue is: How to show the current record after the refresh? If the above
    code is not correct, or not the most adequate, please don't hesitate and tell
    me.
    Thanks.

    You can do this as follow:
    1) In your ApplicationModule (e.g ScottAM) define function:
    public void refreshView(){
    getMainViewObject().executeQuery();
    2) Expose this function to client
    3) In your manage bean define:
    public String commandButton_save_action() {
    String dc = "#{data.ScottAMDataControl.dataProvider}";
    FacesContext ctx = FacesContext.getCurrentInstance();
    ValueBinding vb = ctx.getApplication().createValueBinding(dc);
    ScottAM am = (ScottAM)vb.getValue(ctx);
    am.refreshView()
    return null;
    Note, that this solution will set you on the first row after invoke.

  • OO4O output cursor just ruturn part of the records

    Hi,
    I use VB and OO4O to call an oracle stored procedure, but the output ref cursor just return part of the records, for example, I supposed to get 300 records, but it just return first 100 records.
    If anyone know what is wrong and how to fix it?
    Thanks for any help.
    William

    To use an external decoder connection, your setting in the DVD player software should be to use SPDIF output, and your speaker setting should be 2 speakers. If you use the multichannel analog inputs also common on receivers, you can actually use more than 2 of your soundcard's channels.
    But that's just an attempt to give you some raw material for some insight....
    The digital outputs should always be acti've unless you're playing high-resolution DVD-Audio. That does tell us there's some sort of capability for forcing the digital
    output off. It may be that it is being turned off when it shouldn't be. It's also
    possible that something's changing AC3 bits when this shouldn't happen. All this points to some sort of corruption (a poison pill has found it's way into your registry, perhaps), or to some other misbehaving software (likely a driver if so). Did you install any new devices when you did the XP upgrade? If so, try getting updated drivers for those, first.
    Then if that seems to have no effect, try removing and reinstalling the CL software, using "cleansweep" procedures for a more thorough reinstall. Otherwise, I'd start seriously considering starting over with a clean OS reinstall.
    -Dave
    [email protected]

  • RMS -- Getting the RecordId of the Current Record

    Hello, I need to get the current record Id from recordStore so I can update a count field. Here is the code that updates the count field.
    // member vars to hold RMS stuff
    private RecordStore rs;
    private RecordEnumeration re;
    private ByteArrayOutputStream os;
    // Constructor allocates RMS vars
    public Ctor ( String sRmsFilename ) throws Exception {
    rs = RecordStore.openRecordStore ( sRmsFilename, false );
    re = rs.enumerateRecords ( null, null, true );
    re.keepUpdated ( true );
    os = new ByteArrayOutputStream ();
    ////// METHOD REQUIRING CURRENT RECORD ID
    private void updateDBCount ( int count ) throws Exception {
    DataOutputStream dos = new DataOutputStream ( os ) ;
    dos.writeInt ( count );
    *int currentRecordId = {color:#008080}getCurrentRecordId {color}();*
    byte[] b = os.toByteArray ();
    os.reset ();
    rs.setRecord ( currentRecordId, b, 0, b.length );
    This is the code that I use to retrieve the recordId of the current record;
    ////////// CODE TO RETRIEVE CURENT RECORD ID
    private int getCurrentRecordId () throws Exception {
    *if ( re.{color:#0000ff}hasPreviousElement{color} () ) {*
    *re.{color:#0000ff}previousRecordId{color} ();*
    *return re.{color:#0000ff}nextRecordId{color} ();*
    *else {*
    *re.{color:#0000ff}nextRecordId{color} ();*
    *return re.{color:#0000ff}previousRecordId{color} ();*
    This is how getCurrentRecordId () is suppose to work, using RecordEnumeration. If there is a previous record then advance backwards to previous record. Now advance forward to next record and this should been the current record Id and so it is return. However, if there is no previous record then advance forward to next record. Now advanced backward to previous record and this should been the current record Id and so it is return.
    Well, does anyone see a problem with this code? If so please let me know and, of course, as always any suggestions are very welcome!
    Note: The reason I chose to use RecordEnumeration.nextRecordId () / previousRecordId () methods is because I figured it is run fast and less resources would be consumed than if actual records were retrieved using RecordEnumeration.nextRecord () / previousRecord ()methods.
    Thanks!

    {color:#000080}I see a problem if the RecordStore has no records, or only one record. This is what I might do (untested)private int getCurrentRecordId () throws Exception
        if ( re.numRecords() == 0 )
            // maybe you want to add a record
            // or maybe throw a new Exception
            // or just return -1 or 0 and
            // let the calling routine handle that
            return -1;
        } else if ( re.numRecords() ==1 )
            return 1;
        } else if ( re.hasPreviousElement () )
            re.previousRecordId ();
            return re.nextRecordId ();
        } else
            re.nextRecordId ();
            return re.previousRecordId ();
    }Regarding running fast, the documentation for javax.microedition.rms.RecordEnumeration says{color}
    keepUpdated - if true, the enumerator will keep its enumeration current with any changes in the records of the record store. Use with caution as there are possible performance consequences.{color:#000080}
    Actually, since you do not have a filter or comparator, it would probably be more efficient to keep track of the current record with a int instance field. But that's your choice.
    Cheers, Darryl{color}

Maybe you are looking for

  • How to get the most from your MyBT account and rea...

    If you register for free online billing at www.bt.com/youraccount you'll benefit from having your BT account information at your fingertips online. Sign up to: View all your bills, stored online for 6 months Easily pay your bill or change your paymen

  • Problem with my

    After transfer photos taken the volume control button on my computer they are flipped upside down. When editing the auto improvement in the phone, after the transfer to my computer I can turn them into the program on my computer, but I can't save ore

  • Qulaity Certificate "Output Type " for delivery

    How does the working of Output Type LQCA & LQCB differ ?

  • Weird chart shifting problem?

    I'm having a problem that's easy to reproduce. Create a pie chart on a blank slide (the default data will work fine). In the inspector move the Labels so they are outside of the pie chart -- around the perimeter. Now set the chart so the build is by

  • CSS does not start using 11g RH4 SCSI drives

    Hi All... Followed all necessary procedures for setting up oracle. The problem is when I try and get ASM working, I get to the part that says CSS is not running and then do a $ORACLE_HOME/bin/localconfig add as root with all environmental variables s