Skip 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.

Script to check all records for flag

Featured Replies

Is there a way to loop through a field in all records to check it it's flaged?

Here's what I am wanting to do. I want to be able to flag a certain item as preferred. When I go to flag this item I want it to first check that there is not a product of this type already flaged. I have hundered of products and I am afraid that it will strain the system, but it would be worse if 2 of the same items were flaged preferred.

my product is Product::SKU

So I would want to loop through all the Product::SKU that are identical to the one that I am entering.

something like this.....

loop-----

if(Entered::SKU = Product::SKU and Product::Flag = 1)

"Product already flaged, would you like to change it?")

else

Product::flag = 1

end if

Not sure how to loop it so it reads all the Product::SKU's in exsistance.

One approach would be:

Set field ( globalSKU ; Entered::SKU )

New window ("temp find")

#

Enter Find Mode

Set field (Product::Flag ; 1)

Set field (Product::SKU ; globalSKU)

Set error capture ON

Perform Find

#

If(Get ( FoundCount ) > 0 )

. Show custom dialog ( "change it...?" )

. If ( Get ( LastMessageChoice ) = 2 )

# default button 1 is YES, button 2 is NO

. . Close window ("temp find")

. . Exit Script

. Else

. . Set field (Product::Flag ; "" )

. End If

End If

#

Close window ("temp find")

Set field (Product::Flag ; 1)

I'm not the expert on this, but... look into creating a self-join in the relationship diagram based on the field in question. Then, you can quickly determine whether there is a record on the other side of the link--without scripting, or with minimal scripting, as the case might be.

David

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.