2 Replies Latest reply on Jul 14, 2009 9:24 AM by kapitaen_1

    Looping Problem

    knightmare

      Title

      Looping Problem

      Post

      Hello

       

      I am a beginner at FM and I want a loop that takes information from one record and loops through and takes all the information for each record that pertains to the requirement and then pastes it all in another record. Basically if two categories equal each other then I want one category from the first record to be pasted in another record. So Far I have:

       

      Loop

       Go to Layout["ICN Form" (ICNs)]

       Go to Record/Request/Page [First]

       If [ICNs::ICD RTN Impacted]=ICD Requirements::RTN]

        Copy[Select;ICNs::Icn #]

        Go to Layout ["EELV IVF' (ICD Requirements)]

        Paste[Select;ICD Requirements::Open ICN#]

       End if

       Go to Record/Request/Page[next; Exit after last]

      End Loop

       

      Thanks

        • 1. Re: Looping Problem
          etripoli
            

          Here's another possible way to solve the problem:

           

          Create a calculation field in ICNs, = Case (  ICD RTN Impacted = ICD Requirements::RTN, 1 )

          Add that field to your ICN Form, as a checkbox (using a value list with a single value: 1 )

          Do a find in that layout for any records with the box checked

          Use this loop script:

           

          Loop

           Set Field [ICD Requirements:Open ICN#; ICNs::ICD RTN Impacted]

           Go to Record/Request/Page[next; Exit after last]

          End Loop

           

          • 2. Re: Looping Problem
            kapitaen_1
              

            hi knightmare,

            one fast thought ... having the goto first record inside the loop will work on the first record forever. Your goto next record will have no effect, it will be reset to the first record again in the next iteration of the loop.

             

            greetings from germany

            chris