Method Community

 

Do While in Screen Actions

Last post 09-16-2015 5:24 PM by Matt. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 09-16-2015 2:53 PM

    Do While in Screen Actions

    I would like to be able to process screen actions in a "Do While" fashion where I don't know how many iterations will be needed.  Because Method does not have DO While or Do Until capability, I've set up a loop through a dummy table with a Counter column and specify "Start loop through table, where Counter is less than Type In 99".  I would like to be able to stop looping when I reach some condition and not keep looping for 99 iterations.  I can't use Stop Processing More Actions, because I DO need to be able to process actions after the End Loop Through Table command.  

    I would greatly appreciate any suggestions or tips...  

    Thanks,

    Pam

    Pamela Keffer
  • 09-16-2015 3:20 PM In reply to

    Re: Do While in Screen Actions

    Hey Pam,

    I can see how that can be tough to accomplish using If/Else condition statements along side Stop Processing More Actions.

    I have put in a feature request to have a do while/do until/for loop added as an option to screen logic. I’ll keep you posted in what I hear back from our development team.

    Also if you want to post what you are trying to accomplish, I can try to put together a workaround solution for you.

    -- Mortaza

    Morty Barighzaai
    Customer Success Manager
    Method:CRM
  • 09-16-2015 4:12 PM In reply to

    Re: Do While in Screen Actions

    Thanks for the note Mortaza.

    I am parsing a field of data using Seek Next in Selection List.  I don't know how many items are in the list. When I get to the point where the Seek result is blank, I want to stop that section of the screen actions.

    Pamela Keffer
  • 09-16-2015 5:24 PM In reply to

    • Matt
    • Top 10 Contributor
    • Joined on 11-04-2008
    • Posts 877

    Re: Do While in Screen Actions

    Hi Pam,

    You should be able to accomplish this by creating an action result called "keepProcessing" and set its value to true before the loop. Then put everything inside of the loop in a conditional statement if keepProcessing = True. When you get to the case where you want to stop set the value of keepProcessing to False. It would look like this:

    set AR keepProcessing = True

    Loop Number Table   

         If next is blank

              set keepProcessing = False

          End If  

         If keepProcessing = True

            do what you want here      

          End If

    End Loop

    Hope that helps!


    Matt Raiser

    Founder,



    www.techinthefield.com

    matt@techinthefield.com

    219-221-9500



    ~ Method user / partner since 2008

    ~ Over 15 years field service experience

    ~ 2013 Method Partner of the Year

    ~ Degree in Computer Science





    Creator of:


        


Page 1 of 1 (4 items)