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.

Pause script if being run by another user?

Featured Replies

I have a script that creates an ad-hoc report. Based on global field selections, a user can select what data they want to appear in a report.

It works very well, except in a multi-user environment. If two users try to set the global fields and run the script at the same time, the correct data may not come through.

Is it possible to pause a script if it is being run by another user on the network?

What do you mean by: "based on global field selections, a user can select what data they want to appear in a report." This could mean several things, and I'd rather not guess.

Two users should easily be able to run the same report. Globals used for setting finds (if that's what you're doing) or as switches for sub-summary choices (and sort orders) are multi-user friendly. So, something else is at work here.

Can you be more specific?

  • Author

Here is how i have the basic functionality set:

A layout has checkboxes for a bunch of different status types (based off of global repeating field).

A user selects what statuses they want to appear in a report. The script that generates the report checks if each status type is selected, and if so performs a find for the corresponding value, and sets a flag field with the user account name.

After all status types have been checked a find is performed for all the flagged records, then the report is generated. After running the report, the flags are erased.

When multiple users try this, it seems that the data may only come through for one user.

Hope that makes sense. thanks.

and sets a flag field with the user account name.

This is where you may possibly be having the issue. Could you elaborate what you mean by setting a flag field with the account name? Is this field a global as well?

Global fields will be specific the each user's session.

Edited by Guest

  • Author

No i dont have it set as global. What i am trying to do is just flag all the records that should be included in the report for that instance that it is run. It seemed to work well, but when i tried it with another user, the data only got pulled in for one of us.

Maybe there is a better way to create ad hoc report options?

There are multi-user friendly methods to flag records, and a search on this site will find them, but I don't understand why you need to flag a record.

It seems that you've built a find interface. The user sets globals, then these values are used to perform a find. Can you confirm this?

Why does a record need to be flagged? Typically, flagging is necessary when a user is picking from a list of records which doesn't sound like your routine.

  • Author

It seems that you've built a find interface. The user sets globals, then these values are used to perform a find. Can you confirm this?

Yes, essentially that is what i am doing. I perform an "If checked, enter find, Set Task Status Field = value" find request for each status. i then flag the results for each one.

I am doing the flagging because i also need to perform a find on a different table which is used to set what higher level groupings should be in the report. Then i go to the report layout and perform a search for those higher level records.

The task status records are shown through a portal, and are self-related by the flagged value to a flagged global calc to Get(account name)

Sorry if i dont explain this well!

I have this gut feeling that the flag isn't needed.

Have you tried finding the lower-level records (child records, perhaps) and using the go to related records of ALL FOUND to get to the parents?

Then, you're looking at a sub-summary report.

  • Author

the parents are a selection option as well. could i still use a GTRR command without the flags at the parent level?

What i am trying to do is just flag all the records that should be included in the report for that instance that it is run. It seemed to work well, but when i tried it with another user, the data only got pulled in for one of us.

If you are setting fields in the records themselves then you are changing the values for ALL the users.

Instead you should collect the records IDS of which records you want in a global field.

I still don't see why you need to flag records, unless when you find for the multiple status types, you feel that you need to find status1, flag this found set, then find status2, flag this second found set. Then, to get all your found records, you find the flags. Is this what you're doing? Do you realize that you can do many find requests at once?

Here's a demo. Hope this helps. If not, how about describing your tables and relationships?

Also, here's a thread that has a demo of how to mark records in a multi-user friendly way: Link

MultiFind.fp7.zip

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.