Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

  • Newbies

Attempting to loop through found set and change status. I don't know get(last error) code that signifies no more records in found set and to break out of loop. Any help appreciated.

loopcode.gif

If I am understanding your situation correctly, you only need to check the box for "Exit after last" on the script step Go to Record/Request/Page[Next].

It should read

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

when that box is checked.

If you find it convenient to avoid looping over the records at all, there is a script step that can set the value of the field for all of the records in the current found set.

Replace Field Contents[No dialog; SHOES::status_shoe; "Pending Insert"]

can be used instead of the entire Loop ... End Loop sequence.

Two thoughts:

1. Looping thru records allows you to trap for record lock. Very important for status changes. You may consider using Todd Geist's transaction technique (http://www.geistinteractive.com/content/inventory-transactions). That is, edit the records in a portal, and when you commit the parent, all children are committed. If you cannot, then you can rollback all edits.

2. I cringe when I see words for Status. I feel it is better to have a flag field, flag_IsPendingInsert that equals 1 if this is the status. Calc the words using case statements. Users like to change words, and then the data integrity is challenged.

Edited by Guest

Your script needs a few things.

try this

jedupree

Show Custom Dialog [ Title: "Shoe Change Status"; Message: "Be Very Careful"; Buttons: “OK”, “Cancel” ] 

If [ Get ( LastMessageChoice ) = 1 ]

     Perform Find [ Specified Find Requests: Find Records; Criteria: Status::Order: “=” ] [ Restore ]

     Sort Records [ Specified Sort Order: Status::Order; ascending ] [ Restore; No dialog ]

     Go to Record/Request/Page

          [ First ] 

Loop

     Set Field [ Status::Status Shoe; "Pending Insert" ]

     Go to Record/Request/Page

          [ Next; Exit after last ] 

End Loop

End If 

Go to Layout [ original layout ] 

Show All Records

HTH

Lee

  • Author
  • Newbies

Worked like a champ! Can't believe I didn't notice the check box but a newbie. Thanks so much!

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.