Looping thru a block

In a Form, I have a data block that displays multiple records. I need to process thru each record. I have the code:
go_block('block_name') ;
first_record ;
while :system.last_Record <> 'TRUE' loop
<code> ;
next_record ;
end loop ;
<code> ;
I have to put <code> after the loop to process the last record. How can I have a loop that processes all records including the last one?
Thanks, Wayne

good idea for the NEW check !
You should also check that every navigation call succeeded
including each of the GO_BLOCK, FIRST_RECORD, NEXT_RECORD calls.
However, doing it once after the GO_BLOCK is probably sufficient.
See bolded code.
go_block('block_name') ;
if not form_success then
  raise form_trigger_failure;
end;
first_record ;
LOOP
<etc>I recommend to include a procedure called CFS and call it after every navigation call.
procedure CFS is
begin
if not form_success then
  raise form_trigger_failure;
end;
end;

Similar Messages

  • PL/SQL how to loop thru SQL statement?

    Hey guys. I have this bit of a complicated problem.
    I have a cursor that selects a DISTINCT field called Term and a StudentID.
    I am looping thru that cursor.
    Inside that loop I have another SQL statement that is pulling all rows from the DB where the Term = the Term and the StudentID= the StudentID from the crusor loop.
    My problem is how do I get all the information/rows returned from that SQL statement? I need to loop thru it somehow, but I am not sure how to do it.
    If there is a better way to get this done feel free to chime in.
    Here is my code.
    /* CURSOR*/
    CURSOR c_GPAPerTerm IS
            SELECT DISTINCT Term, Student_ID FROM course_grades
            WHERE STUDENT_ID = p_StudentID;
                 /* OPEN AND LOOP THRU CURSOR*/
        OPEN c_GPAPerTerm;
        LOOP
        FETCH c_GPAPerTerm INTO v_Terms,v_StudentID;
                /* SQL STATEMENT NEED TO LOOP THRU AND GET VALUES FOR EACH ROW*/
                SELECT Score
                INTO v_Scores
                FROM course_grades
                WHERE Term = v_Terms and StudentID = v_StudentID;
        EXIT WHEN c_GPAPerTerm%NOTFOUND;
        END LOOP;
        CLOSE c_GPAPerTerm;

    Ok here's my complete code....it's pretty big though...hope it's not too confusing.
    It compiles fine if I take the new cursor out, so the error is somewhere in that cursor.
    CREATE OR REPLACE PROCEDURE get_Student_GPA(p_StudentID IN NUMBER) AS
         /*VARIABLES*/
         v_Terms VARCHAR2(6);
         v_Courses VARCHAR2(6);
         v_Scores NUMBER;
         v_Grade CHAR;
         v_GPA NUMBER;
         v_ScoresTotal NUMBER :=0;
         v_StudentID NUMBER;
         /*CURSORS*/
         CURSOR c_GetTerms IS
              SELECT Term
              FROM course_grades
              WHERE STUDENT_ID = p_StudentID;
         CURSOR c_GetCourseAndGrade IS
              SELECT Course_ID, Score FROM course_grades
              WHERE STUDENT_ID = p_StudentID;
         CURSOR c_GPAPerTerm IS
              SELECT DISTINCT Term, Student_ID
              FROM course_grades
              WHERE STUDENT_ID = p_StudentID;
         CURSOR c_GetScores (p_Term VARCHAR2, p_StudentID NUMBER) IS          
                   SELECT Score
                   FROM course_grades
                   WHERE Term = p_Term AND StudentID = p_StudentID;
         /*FUNCTIONS*/
         FUNCTION convert_grade(p_GradeNumber IN NUMBER)
              RETURN CHAR IS
         BEGIN
              /* GET NUMERIC GRADE AND CONVERT TO LETTER */
              CASE
                   WHEN p_GradeNumber < 60 THEN RETURN 'F';
                   WHEN (p_GradeNumber > 59  AND p_GradeNumber < 70) THEN  RETURN 'D';
                   WHEN (p_GradeNumber > 69  AND p_GradeNumber < 80) THEN  RETURN 'C';
                   WHEN (p_GradeNumber > 79  AND p_GradeNumber < 90) THEN  RETURN 'B';
                   WHEN (p_GradeNumber > 89  AND p_GradeNumber < 101) THEN RETURN 'A';
              ELSE    RETURN 'Z';
              END CASE;
         END convert_grade;
         FUNCTION calculate_gpa(p_TotalHourPoints IN NUMBER, p_TotalHours IN NUMBER)
              RETURN NUMBER IS
              /*CREATE VARIABLE TO HOLD GPA*/
              v_GPA NUMBER;
         BEGIN
              /*CALCULATE AND OUTPUT GPA*/
              v_GPA := p_TotalHourPoints/p_TotalHours;
              RETURN v_GPA;
         END calculate_gpa;
         FUNCTION calculate_point (p_Grade IN CHAR)
              RETURN NUMBER IS
         BEGIN
              /* GET LETTER GRADE AND CONVERT TO NUMBER */
              CASE
                   WHEN p_Grade = 'A' THEN RETURN 4;
                   WHEN p_Grade = 'B' THEN RETURN 3;
                   WHEN p_Grade = 'C' THEN RETURN 2;
                   WHEN p_Grade = 'D' THEN RETURN 1;
                   WHEN p_Grade = 'F' THEN RETURN 0;
              ELSE    RETURN 0;
              END CASE;
         END calculate_point ;
    /****BEGIN MAIN BLOCK********/
    BEGIN
         DBMS_OUTPUT.PUT_LINE('**********TERMS**********');
         OPEN c_GetTerms;
         LOOP
         FETCH c_GetTerms INTO v_Terms;
         DBMS_OUTPUT.PUT_LINE('Term: ' || v_Terms);
         EXIT WHEN c_GetTerms%NOTFOUND;
         END LOOP;
         CLOSE c_GetTerms;
         DBMS_OUTPUT.PUT_LINE('**********COURSES AND GRADES**********');
         OPEN c_GetCourseAndGrade;
         LOOP
         FETCH c_GetCourseAndGrade INTO v_Courses, v_Scores;
            v_Grade := convert_grade(v_Scores);
         DBMS_OUTPUT.PUT_LINE('Course: ' || v_Courses || '   Grade: ' || v_Grade);
         EXIT WHEN c_GetCourseAndGrade%NOTFOUND;
         END LOOP;
         CLOSE c_GetCourseAndGrade;
         DBMS_OUTPUT.PUT_LINE('**********GPA PER TERM**********');
         OPEN c_GPAPerTerm;
         LOOP
         FETCH c_GPAPerTerm INTO v_Terms,v_StudentID;
                      /*NEW CURSOR LOOP WILL GO HERE*/
                   v_ScoresTotal := v_ScoresTotal + v_Scores;
                      v_GPA := calculate_gpa(v_ScoresTotal, 3);
                   v_ScoresTotal :=0;
                   DBMS_OUTPUT.PUT_LINE('Term: ' || v_Terms || '   GPA: ' || v_GPA);
         EXIT WHEN c_GPAPerTerm%NOTFOUND;
         END LOOP;
         CLOSE c_GPAPerTerm;
    END get_Student_GPA;
    /

  • Itunes wont let me download anything for my ipod touch.  everytime i try to it keeps looping thru to verify my account, so i do and then try to download and it loops me right back thru again to verify my account.  HELP ME PLEASE :(

    everytime i try to it keeps looping thru to verify my account, so i do and then try to download and it loops me right back thru again to verify my account.  HELP ME PLEASE

    Contact iTunes.  Select the appropriate topic of:
    Apple - Support - iTunes

  • Looping thru column names based on a variable value

    I have an ArrayCollection with a series of columns named
    price1, price2... thru to price10
    I'm trying to loop thru these columns based on a variable
    value, but can't figure the syntax:
    for (var column:int = 1; column < 11; column++){
    testPrice = myGrid.selectedItem.price(column); <-- this
    doesn't work
    }

    Try testPrice = myGrid.selectedItem["price" + column];
    Remember to test that selectedItem isn't null before you try
    to assign the values.
    TS

  • LOOPING THROUGH THE BLOCK

    Can anybody help me with an example or materail which explains how can we loop through a block in Forms 6i?
    Also how we can loop through the details block pertaining to the master block and process those records also?
    Thanks

    The quickest way to do something is not to do it at all, and this looks like a good example of where you don't need to do anything - what I suspect you really need is a better design for your schema. What are you updating that requires an update on all child records and cannot simply be referenced when you query a child record?
    If you can't change the schema and you have millions of records to update then your best bet is to use sql, then try pl/sql if sql can't do the job. Only try forms if you absolutely have to, and expect it to run like a brick.
    In forms (assuming you're using relationships):
    go to each block, do first_record and process each record.
    go to the lowest child block and loop through the records using next_record until "system.last_record = 'TRUE'", processing each record as you go.
    go to the next block up, do next_record and process that record.
    go back to the lowest child block and loop though it, processing each record.
    when you have reached the last record in the penultimate child block then go to its immediate parent block, do next_record and process that record.
    go to the lowest child block etc etc etc
    There are a lot of things which you can do in forms but which belong on the database!

  • Looping thru tif images using OCR

    I have this code below in powershell where I OCR a tif image and save it to a table in sql server.  OCR is only working on the first page and not looping thru the tif image pages.
     Can someone help me with the code to make it loop on my tif image pages ?
     #Functions
    #OCR Function
    #param - imagepath(path the image to ocr)
    Function OCR($imagepath) {
        #create a new modi object
        $modidoc = new-object -comobject modi.document
        $modidoc.create($imagepath)
        try{
            #call the ocr method
            $modidoc.ocr()
            #single page document so I only need the item(0).layout text
            $modidoc.images.item(0).layout.text
        catch{
            #catch the error and go on
            return "Error"
        Finally
            #clean up the object
            $modidoc = ""
    } # end OCR function
    #Function to update the fulltext field in imageskeyvalues table
    #param ID(ID of table)
    function SaveImagesKeyValues($ID, $fulltext)
    $cmd = new-object system.data.sqlclient.sqlcommand
    $cmd.connection = $sqlconnection
    $s = "update dbo.Images_Local set fulltext = '" + ($fulltext.tostring()).replace('''','') + "' where ID = " + $ID.tostring() 
    $cmd.commandtext = $s
    $a = $cmd.executenonquery()
    } #end SaveImagesKeyValues
    #Function to get the list of records to OCR
    function GetImagesKeyValues()
    $sqlda = new-object system.data.sqlclient.sqldataadapter
    $datatable = new-object system.data.dataset
    $sqlcommandselect = new-object system.data.sqlclient.sqlcommand
    $sqlcommandselect.commandtext = 
        "select ID, FullImagePath, fulltext from images_Local  
    where (fulltext is null or fulltext like 'error%')  order by ID "
    #and (fulltext is null or fulltext like 'error%') 
    #"select b.batch_number, b.sequence_number,a.claimnumber, a.potentialamount,a.buyer, b.[document type],b.fulltext, c.imagelastmodified, c.image_path
    #from cip.dbo.cip_mastertable a 
    #inner join imageskeyvalues b on a.claimnumber = substring(b.[claim number],2,6) 
    #inner join images c on b.batch_number = c.batch_number and b.sequence_number = c.sequence_number
    #where (a.buyer = '006' or (a.buyer = '007' and a.potentialamount > 500000))
    #and c.imagelastmodified >= '1/1/13'
    #and b.[document type] = '2'
    #order by c.imagelastmodified"
    $sqlcommandselect.connection = $sqlconnection
    $sqlda.selectcommand = $sqlcommandselect
    #Fill the datatable and store the output in variable otherwise it shows in the output.
    $trap = $sqlda.fill($datatable)
    $datatable.tables[0]
    #end GetImagesKeyValues
    #End Functions
    #Main
    clear
    #set the parent path to the working directory
    $parentpath = "C:\Data\Portugal PRG\Images\Contratos SONAE 08-11\Imdex\"
    #Create new sql connection
    $sqlconnection = new-object system.data.sqlclient.sqlconnection
    #Assign the connectionstring 
    $sqlconnection.connectionstring = "Server=ATL01L20969\SQLEXPRESS;Database=Sonae;integrated security=True"
    #Open the connection
    $sqlconnection.open()
    #get the list of records that need ocr'd
    $imageskeyvalues = getimageskeyvalues
    #iterate through the list 
    foreach ($t in $imageskeyvalues){
    #$completepath = $parentpath + $t.image_path
    $completepath = $t.FullImagePath
    #call the ocr function and put the results in the fulltext property
    $t.fulltext = OCR $completepath
    #give some bread crumbs to monitor the script
    write-host  "Saving " $t.ID 
    #update the database fulltext filed
    Saveimageskeyvalues $t.ID $t.fulltext
    }#end Main

    Hi Abenitez,
    Since the OCR is only working on the first page, as a workaround, please try to spilt the tiff files to multople single files:Tiff Splitter, and then you can use foreach to loop every files.
    Refer to:
    How to split a multipage TIFF file on Windows?
    If there is anything else regarding this issue, please feel free to post back.
    Best Regards,
    Anna Wang

  • PL/SQL...Unsure how to loop thru multiple questions and display output?

    This is my first pl/sql program, I've written psudocode on paper, but not sure what to do for two parts.
    What I'm trying to do is write pl/sql that will check a row based on an employee id #.
    declare
    cursor cur is
    select *
    from employee
    where employee_id = foo;What we are checking are the results the employee answered. They have answered 180 questions and I want to find when the answer a 0, 7, and 9.
    Basically the pl/sql has to loop thru the 180 questions
    loop
    v_count := vcount + 1
    select *
    from employee
    where q1 thru q180 in (0, 7, 9);
    end loop;
    dbms_output.put_line ('Employee ID' || employee_id);
    dbms_output.put_line ('Q1 - Q180' || q1 - q180); I'm not sure how to write the pl/sql to loop thur all 180 questions.
    I'm not sure how to display the output to show what question they scored a 0, 7, and/or a 9 on.
    thanks
    Message was edited by:
    cmmiller

    536 columns in one table? Yowsa. Without a normalized table, you are going to need dynamic pl/sql and a messy solution.
    I would rethink your design, and come up with something more like so:
    employee
    questions
    employee_responses
    So that would you could easily do something like this:
    declare
      cursor c1 is
        select ers.question_id,
               que.question_name,
               ers.rating
          from employee emp,
               questions que,
               employee_responses ers
         where emp.employee_id = ers.employee_id and
               que.question_id = ers.question_id and
               emp.employee_id = v_employee_id and
               ers.rating in (0, 7, 9) and
               que.enabled_flag = 'Y';
    begin
      for r1 in c1 loop
        dbms_output.put_line('Question: '||r1.question_name);
        dbms_output.put_line('Employee Rated this: '||r1.rating);
      end loop;
    end;Thats how I would do it - I think you are going down the wrong path. What happens if you need to create a new question or delete one? You constantly have to modify the table. Hope this helps

  • How to Loop thru a Queue?

    I have a Queue that I can add and remove items from, but I need to display all the contents currently in the Queue.
    How would I loop thru the Queue and do this?
    Any simple example will do.
    Thanks!

    Thanks for the link. It showed me which methods an Iterator has, but not practical way to use it. So I did some googling and found this example.
    import java.util.Iterator;
    import java.util.NoSuchElementException;
    for ( Iterator iter = myList.iterator(); iter.hasNext(); )
       String key = (String) iter.next();
       System.out.println( key );
       }Which makes perfect sense. However, where it says Iterator iter = myList.iterator(); I am not sure what to put in the myList.iterator(); part.
    I would assume that my Queue object would be used there, however, my Queue object has no .iterator() method.
    Like I said, I am new to Java so this is not as easy to me as it seems it should be.
    But there is all of my code if it helps.....I'll leave out the unimportant parts.
    Queenode class........................................
    public class QueueNode {
    //fields
    Object info;
    QueueNode link;
        public QueueNode() {
        public QueueNode(Object item) {
        info=item;
        link=null;
        public QueueNode(Object item, QueueNode qn) {
            info=item;
            link=qn;
    }//end classQueue class..............................................
    public class Queue {
       //create a front and back node
       private QueueNode front;
       private QueueNode rear;
       private int size;
       //methods
       public void insert(Object item){
          //if queue is empty front and rear are same
          if(isEmpty()){
              rear=new QueueNode(item);
              front = rear;
          }//end if
          //otherwise queue not empty add top end
          else{
              rear.link= new QueueNode(item);
              rear=rear.link;
          }//end else
          ///either case incriment size
          size++;
       }//end insert
       public Object remove(){
           //create a temp node referencing the front
           QueueNode oldFront=front;
           //peek at front item
           Object item = peek();
           //make front to link with the next node
           front=front.link;
           //remove temp node
           oldFront=null;
           //decrement size
           size--;
           //return the item that was removed
           return item;
       }//remove
       public Object peek(){
           if(isEmpty()){
               throw new NullPointerException();
           }//end if
           else{
               return front.info;
           }//and else
       }//end peek
       public boolean isEmpty(){
           return(size==0);
       }//end isEmpty
       public int getSize(){
           return size;
       }//end getsize
    }//end classAnd finaly my class to test that the Queue is working....................
    import javax.swing.*;
    import javax.swing.border.BevelBorder;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Iterator;
    import java.util.NoSuchElementException;
    public class QueueTest extends JFrame implements ActionListener{
        //Create Queue object
        Queue q = new Queue();
       public QueueTest(){
            //Add title to window
            super("Testing Queue's");
         }//end constructor
        public void actionPerformed(ActionEvent event){
            if (event.getSource()==btnAddQueueItem){
                q.insert(txtAddQueueItem.getText());
                for(Iterator iter = q.?????; iter.hasNext();){
                    ///Output each queue item here........
                }//end for
            }//end if
             if (event.getSource()==btnRemoveQueueItem){
                 q.remove();
             }//end if
        }//end actionPerformed
        public static void main(String[] args) {
        QueueTest testQueue = new QueueTest();
        }//end main
    }//end class

  • How to Loop thru a RFC model

    how to Loop thru the RFC model
    for(int i=0;i<wdContext.nodeEx_Org_Units().size();i++){
    //how to get the attribute each and every columns
      //mgr.reportSuccess("id" +nodeEx_Org_Units().getId());
    Message was edited by:
            yzme yzme

    Hi,
    When there is a RFC Model with table ouptut....every row in the table can be correlated to elements in the model node...
    your model node : <i>nodeEx_Org_Units</i>
    Now if you have 5 rows as output after executing the model...there will be 5 elements created under the node. Loop through all the elements and use the get methods as given below:
    // assuming tht u have two columns(attributes) <i>col1 & col2</i>
    // access the node
    IPrivate<view>.IEx_Org_UnitsNode tableNode = wdContext.nodeEx_Org_Units();
    // access the element under the node, do not initalize this element
    IPrivate<view>.IwdContext.nodeEx_Org_UnitsElement tableElem;
    //loop thrugh the elements
    for(int i=0; i<tableNode.size(); i++)
       tableElem = tableNode.getEx_Org_UnitsElementAt(i);
       // access the attributes col1 & col2
       tableElem.getCol1();
       tableElem.getCol2();
    Regards
    Srikanth

  • LOOPING THRU LINE ITEM

    HI IAM TRYING TO VALIDATE  FIRST CHECKING WHTETHER THE BILLING PLAN IS AT THE HEADER LEVEL OR AT THE ITEM LEVEL.
    HOW CAN I LOOP THRU ALL THE ITEMS IF THE BILLING PLAN IS AT THE ITEM LAVEL I NEED TO LOOP THRU ALLL THE ITEMS!!SOME OF THEM MAY HAVE BILLING PLAN AT THE ITEM LEVEL AND SOME AT THE HEADER LEVEL.
    PLSS TELL ME HOW TO DO IT FOR THE ITEM LEVEL.
    POINTS PROMISED!!

    i have done the code this way will it work???
    TYPES: BEGIN OF gst_fpla,
            fplnr TYPE fpla-fplnr,
            vbeln TYPE fpla-vbeln,
            rfpln TYPE fpla-rfpln,
            END OF gst_fpla.
      TYPES: BEGIN OF gst_fplt,
            fplnr TYPE fplt-fplnr,
            fproz TYPE fplt-fproz,
            fareg TYPE fplt-fareg,
            END OF gst_fplt.
    TYPES: BEGIN OF gst_fplt1,
           fplnr type fplt-fplnr,
           end of gst_fplt1.
      DATA: gi_fpla TYPE STANDARD TABLE OF gst_fpla.
      DATA: gi_fplt TYPE STANDARD TABLE OF gst_fplt.
      DATA: gw_fpla TYPE gst_fpla.
      DATA: VAR1(1) TYPE C.
      DATA: VAR2(9) TYPE C.
      DATA: GW_XFPLA LIKE XFPLA.
      DATA: gw_fplt TYPE gst_fplt.
      TYPES: BEGIN OF GST_RFPLN,
              RFPLN TYPE FPLA-RFPLN,
            END OF GST_RFPLN.
    DATA: GI_RFPLN TYPE STANDARD TABLE OF GST_RFPLN.
    DATA: GW_RFPLN TYPE GST_RFPLN.
    data: gi_fplt1 type standard table of gst_fplt1.
    data: gw_fplt1 type gst_fplt1.
      IF ( sy-tcode = 'VA01' OR sy-tcode = 'VA02' OR sy-tcode = 'VA21' OR  sy-tcode = 'VA22' ) AND ( vbak-auart = 'ZQT' OR vbak-auart = 'ZNS' ).
    IF RV45A-KFREL = 'X'.
      IF XFPLA[] IS NOT INITIAL.
      LOOP AT XFPLA INTO GW_XFPLA.
      GW_RFPLN-RFPLN = GW_XFPLA-RFPLN.
      APPEND GW_RFPLN TO GI_RFPLN.
      ENDLOOP.
    SPLIT GW_XFPLA-RFPLN AT '$' INTO VAR1 VAR2.
    DATA: BEGIN OF MRFPLN,
              rfpln1 type c length 1 value '0' ,
              rfpln2 type c length 9 value '',
              end of MRFPLN.
          MRFPLN-rfpln2 = VAR2.
    DATA: RFPLN TYPE STRING.
      RFPLN = MRFPLN.
    CONDENSE RFPLN.
      SELECT fplnr vbeln rfpln FROM FPLA INTO TABLE gi_fpla  FOR ALL  ENTRIES IN GI_RFPLN WHERE fplnr = GI_RFPLN-RFPLN.
    ENDIF.
      loop at gi_fpla into gw_fpla.
      if gw_fpla-vbeln = '' and gw_fpla-rfpln = ''.
      READ TABLE xfpla WITH KEY rfpln = gw_fpla-fplnr.
      if sy-subrc NE 0.
      MESSAGE  W047(YD01).
      write:'invalid reference number'.
      else.
      gw_fplt1-fplnr = gw_fpla-fplnr.
      append gw_fplt1 to gi_fplt1.
        ENDIF.
        ENDIF.
        ENDLOOP.
      ENDIF.
      SELECT fplnr fproz fareg from fplt into  TABLE GI_FPLT for all entries in gi_fplt1 where fplnr = gi_fplt1-fplnr.
      LOOP AT GI_FPLT INTO GW_FPLT.
      READ TABLE XFPLT WITH KEY FAREG = gw_fplt-fareg.
      if sy-subrc NE 0.
      WRITE:'BILLING RULE IS INVALID'.
      ELSE.
    WRITE:'CORRECT BILLING RULE'.
      READ TABLE XFPLT WITH KEY FPROZ = gw_fplt-fproz.
      if sy-subrc ne 0.
      write: 'billing percentage is invalid'.
      else.
      write: 'valid billing percentage'.
      endif.
      ENDIF.
      ENDLOOP.
    ELSE.                                                "ELSE FOR RV45A
    CLEAR: GI_FPLA.
    CLEAR: GI_FPLT.
    CLEAR: GI_RFPLN.
    CLEAR: GI_FPLT1.
    REFRESH: GI_FPLA.
    REFRESH: GI_FPLT.
    REFRESH: GI_RFPLN.
    REFRESH: GI_FPLT1.
    do the validations for item level.
      ENDIF.                                                "for  rv45a-if.
      ENDIF.

  • Looping thru instance manager and checking radio button selected

    I need to loop thru my instances and toggle visible/hidden if a particular radio button in each instance is selected.
    My code right now does not work but I feel I am on the right track (minus the else statement it will need to toggle on/off).
    Can anyone help? thanks in advance!
    var rowCount = BugGroup_f.instanceManager.count;
    for (i=0; i<rowCount; i++) {
    var str = xfa.resolveNode("BugGroup_f.detail3.bugInfo.BugItem.status.RadioButtonList[" + i + "]").rawValue;
        if (str.indexOf("Fixed") > -1) {
        xfa.resolveNode("BugGroup_f["+rowCount+"]").presence = "hidden"

    So we've got a set of Rows, each with a subitem called RadioToggle, and you want to go through and set them all, then click a separate button and hide the ones with "on" radio buttons?
    function ToggleRows(reset){
         var Rows = Form.subform....BugGroup_f.all;
         var curRow;
         for (var i=0; i<Rows.length; i++){
              curRow = Rows.item(i);
              if ((curRow.RadioButton.rawValue == "WhatevermeansHidden") && !reset){
                   curRow.presense = "hidden";}
              else{
                   curRow.presense = "visible";}
    ^ in a script object, and put
    scriptObjectName.ToggleRows(reset);
    in the click event of your button, and you should be golden.
    If you do want them to hide the moment you click the toggle, you could put this, right?
    if (xfa.event.newText == "whatevermeansoff"){
         parent....presense = "hidden";}
    The .all method seems like a much easier way to handle collections of objects, and specificaly collections of instances. It also means you can do relative referencing, i.e. to create a function that will operate on all the rows of a table, without knowing which table it is operating on, so a button in each table can pass it's parent table to the function.
    var GroupVariable = Object.all
    for(var i=0; i < GroupVariable.length; i++)
    EDIT:
    add a reset value, and pass it in to your function like above (added).
    make a separate button, or control, that will call the function with reset = 1.

  • Looping thru enumeration objects

    How to loop thru the enumeration objects?? Thanks.

    If you are using JAVA 5.0 enum, here is an example:
    public class Example
        public enum Season { WINTER, SPRING, SUMMER, FALL }
        public static void main(String[] args)
            for (Season s : Season.values())
                System.out.println(s);
    }

  • Performance question on looping thrue blocks and items (forms 10.1.2.3)

    Hi all,
    I'm back again in Forms forum : ) !!! and I'm working on a new and very interesting project
    version used : Forms [32 bits] Version 10.1.2.3.0 (Production)
    A little question for gurus :
    On former projects I used to call loops on blocks and item like shown below to do various things such as displaying buttons or showing canvas or different VA depending on the user or scenarios .
    PROCEDURE FRM_BLK_ITM_LOOP IS
    v_curblk varchar2(90); -- bloc courant
    v_curitm varchar2(90); -- item courant
    BEGIN
      v_curblk := get_form_property(:SYSTEM.CURRENT_FORM,first_block); -- on récupère le 1er block de la form
      LOOP
      v_curitm := v_curblk||'.'||get_block_property(v_curblk,first_item); -- on récupère le 1er item du block
        WHILE v_curitm != v_curblk||'.'||get_block_property(v_curblk,last_item)
         LOOP -- tant que l'item n'est pas le dernier du block on loop
            v_curitm :=  v_curblk||'.'||get_item_property(v_curitm,nextitem); -- on récupère l item suivant
            if get_item_property(v_curitm,<some property>) = 'TRUE' then
              --- I can do something.... or adding more conditions if then etc...
            end if;
        END LOOP;
      EXIT WHEN v_curblk = get_form_property(:SYSTEM.CURRENT_FORM,last_block); -- on sort losrqu on arrive au dernier block
      v_curblk := get_block_property(v_curblk, nextblock); -- on passe au block suivant
      END LOOP;
    END;In my current project we work on quite huge forms which can have a consequent number of blocks and items.
    And we must be very careful regarding performance issues as these forms are accessed via LAN and WAN.
    So my question :
    This method seems to be quite efficient as it goes thrue blocks and items sequences as they are defined in the builder comparing to go_block -> go_item ->do_something which can easily turn into nightmare-programming.
    But I don't really know about network roundtrips with this kind of method.
    Is everything done in the app server and then fetched to the client?
    What triggers block-level and item-level can be fired during the execution of the loop ? and so one...
    Thanks in advance for your advices on this matter.
    Jean-Yves

    Hmmm, I have to say I never bothered if Forms is in Socket mode or not; I enabled the network statistics, counted the roundtrips and looked for ways to get them lower (my old friend wireshark did also a good job regarding this) ;). But regarding the note Forms 6i uses Socket Connections by default, this might apply to 10g too (or the enhancement request was approved, who knows).
    Frankly I am not entirely sure what Socket Mode means; I guess it's the mode the forms applet talks to the forms runtime; wheter it's stateful (via Sockets) or stateless (via HTTP / HTTPS) but this is just a wild guess, and I can't find informations on it quickly. I also enabled networkStats on my Developer Suite only, so I cannot tell if you can enable them on a full-fledged Application Server.
    Anyway; as said I just counted the roundtrips and looked where I can avoid them when I made our application ready for WAN.
    Another useful tool was Shunra VE Desktop which I used to simulate low bandwith networks with high latencys; I installed it on a virtual XP, started the application and tested how the Application performs. If something looked odd, I looked behind the scenes, built a little testform basing on the code behind and tried out various things; very often you can take advantage of the event bundling forms seems to make when you use several set_xyz calls as Francois also noted; e.g.
    set_custom_property('bean_item', 1, 'PROPERTY', prop);
    set_custom_property('bean_item', 1, 'PROPERTY', prop);
    set_custom_property('bean_item', 1, 'PROPERTY', prop);
    set_custom_property('bean_item', 1, 'PROPERTY', prop);
    set_custom_property('bean_item', 1, 'PROPERTY', prop);
    vRet := get_custom_property('bean_item', 1, 'PROPERTY);most certainly will cause just 1 roundtrip; but if you use get_custom_property in the middle of the set_custom_property calls you will encounter 2 roundtrips as forms needs to synchronize (you get a value from the bean so the forms runtime needs a response) with the forms applet whereas set_custom_property is a one-way-street which can be fired off simultaneous. The same applies to fbean.invoke and fbean.invoke_bool, fbean.invoke_char and the like. Of course if you are using more then one get_custom_property in this case the roundtrips will increase accordingly.
    If you want to make use of event bundling make sure you fire off as much set_xyz as you can before forcing forms to synchronize (e.g. with get_xyz, or synchronize, create_timer,...)
    cheers

  • Foreach loop in static block won't compile

    When I try to compile this:public class TestEnum
      private static String[] numerals =
          {"einz", "zwei", "drei", "vier"};
      static
        for (String n : numerals)
          // doesn't matter what's in here
      public static void main(String[] args)
    }I get this exception:An exception has occurred in the compiler (1.4.2-beta).
    java.lang.NullPointerException
        at com.sun.tools.javac.comp.Lower.visitArrayForeachLoop(Lower.java:2269)
        at com.sun.tools.javac.comp.Lower.visitForeachLoop(Lower.java:2242)
        at com.sun.tools.javac.tree.Tree$ForeachLoop.accept(Tree.java:559)
        at com.sun.tools.javac.comp.Lower.translate(Lower.java:1580)
        at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:51)
        at com.sun.tools.javac.tree.TreeTranslator.visitBlock(TreeTranslator.java:131)
        at com.sun.tools.javac.tree.Tree$Block.accept(Tree.java:497)
        at com.sun.tools.javac.comp.Lower.translate(Lower.java:1580)
        at com.sun.tools.javac.comp.Lower.visitClassDef(Lower.java:1645)
        at com.sun.tools.javac.tree.Tree$ClassDef.accept(Tree.java:409)
        at com.sun.tools.javac.comp.Lower.translate(Lower.java:1580)
        at com.sun.tools.javac.comp.Lower.translate(Lower.java:1594)
        at com.sun.tools.javac.comp.Lower.translateTopLevelClass(Lower.java:2438)
        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:408)
        at com.sun.tools.javac.main.Main.compile(Main.java:523)
        at com.sun.tools.javac.Main.compile(Main.java:41)
        at com.sun.tools.javac.Main.main(Main.java:32)The same thing happens if I use foreach with a Collection instead an array. If I use an old-style for loop or Iterator in the static block, it compiles fine. I can also put the foreach loop in the main method, and it works. Is this a known bug?

    You guys rock. Thanks for finding this problem. I'll get it fixed.

  • Loop on a block

    I have a block with columns item_no, item_name, unit_measurement, item_group, qty_approved, qty_imported and qty_balance.
    On committing this block, a record with 0 balance should be skipped. How can i introduce a loop for the records which are in a block. Anyone to assist me.
    Note: they are committed on a table exm_imp.
    Thanks in advance

    From your post i suppose that by Balance you mean balance_qty.
    For you problem try writing a trigger on Block level with following code
    ON-INSERT
    if nvl(:block.qty_balance,0)=0 then
         null;
    else
         insert_record;
    end if;
    This might help you.
    Regards
    Dhiraj Madan

Maybe you are looking for

  • Inventory Implementation

    Hi , I am implementing the Inventory. Its 7x flow.I am good with all most every steps. I am having issues with activating the transformations.  I am getting error while i am activating the BF and UM transformations. The error is... Start Routine: Syn

  • Media sync to Pre with Windows Media Player

    I am a Volunteer here, not employed by HP. You too can become an HP Expert! Details HERE! If my post has helped you, click the Kudos Thumbs up! If it solved your issue, Click the "Accept as Solution" button so others can benefit from the question you

  • Creating an html file in XI using an xsl stylesheet  -- two error types

    Hi I am working on mapping an xml invoice to an html-file using a stylesheet  (xsl-file)  in the message mapping in XI 3.0. Thus the inbound message is an xCBL Invoice and the output message is to be an html file. I name the output file "%supplierid%

  • Developer Toolbox XML-Export

    Hello, to use html-tags in XML, I have to use a CDATA-Section. Unfortunately, the Export Recordset As XML dose not support CDATA, and converts <, >, &, " to htmlentities. I rewrote the "XMLExport.class.php"-File from Line 195 to 207 like this: 195: /

  • Base station died?

    My airport express base station stopped working. The light no longer comes on. Is there anything to try or do they just die? Ann