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.

Script to Count records in query

Featured Replies

Hi.

I need to make a script where i can find and count the number of record, where two specific values from two field in a file is used as criterion, in the query.

If the number of records is > than 0 then do.... else do..

Thanks

There is a Status(CurrentFoundCount) in FM6 which returns number of records in foundset.

You dont need script for this. You can write your script as

If Status(CurrentFoundCount)>0

______

______

Else

.............

.............

Endif

  • Author

Hi.

Thanks a lot. That part of the script is now working, but every time the script had performed the find funktion, i have to clik "continue" at the layout before the script will execute the rest. Is there anyway to make the script continue by it self.

Thanks

  • Author

Hi.

Here is my script.

the script is executed from the file in the midle of a many-to-many relationship

perform external script (copy value from modelid field to global field)

perform external script (copy value from problemid field to global field)

enter find mode

set field [:modelid","model::temp"]

set field [:problemid","model::temp"]

perform find[constain found set]

If["0<currentfoundcount]

Enter browse mode[]

show message["Problem already exsist to that model"]

exit script

else

Perform script ["addrecord"]

end if

Thanks

You must to find which of this script steps pauses your script and clear pause option

It may be "enter find mode" or "Enter browse mode[]"

  • Author

Hi.

okay it work now, but i have made it in a different way.

Instead i have made a loop where i run through all the records and

send a message if the data in two field in the record is equal with the data in a field in each file.

But thansk for your help anyway and happy new year.

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.