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.

Using Dialogs with multiple windows??

Featured Replies

Hello,

I just stumbled upon a bug in my system which has brought up an interesting problem.

I use a separate window for choosing customers for invoices. The user clicks on the customer name in the invoice and a new window pops up that lets the user do some sorting and searching. Then the user clicks on a customer name which runs a script that populates the customer ID field in the invoice.

The problem is that I choose the Invoices window with a Select Window script step and the window name is hard coded to "Invoices". The order people have discovered Window->New Window so sometimes they have a window up called "Invoices - 2" and when they try to select a customer for that window it ends up modifying the wrong invoice.

I've been trying to think of a way to pass the original window name to the popup, but I can't figure out a solution I really like (as is typical with FM, I guess). I might be able to wire something up with a global and a script that limits the number of popups to just one. What I really want is a way to make the customer chooser modal.

Well, i thought I'd put this to the fmforums crowd to see what you think, or if anyone's dealt with this issue as well.

-J

It may be easier for you to make a value list from your customer table and pop that up for your users.

  • Author

The reason I'm not using a pop-up list is because we have 500 customers and growing, and because the invoice stores customer ID and not customer name, the value list has to be from IDs and additionally show names, this means the user can't type the name and get matches in the list. (it'd sure be nice if a value list could have both values and labels, and only show the labels - like HTML and just about every other programming environment out there)

But the good news is I've solved the problem!. There's no way to pass a parameter to a window, but I was able to use the window name to store what I need.

So in the first script (which opens the dialog) I set the dialog's window name to this:

"Choose Customer: " & Get ( WindowName )

Then in the second script (which sets the customer ID and closes the dialog) I choose the right Invoice window like this:

Select Window[Name: Right ( Get ( WindowName ) ; Length ( Get ( WindowName ) ) - Length ( "Choose Customer: " ) )]

Works like a charm.

I have a couple files in the Sample files section that pop up a window to choose from. They use a portal, with a letter-filtered portal, ie., poor-man's Clairvoyance. The window pops up, is given a name, and enters a Loop/pause; which stops users from clicking outside the window until they make a choice or cancel.

Typing letters filters the portal. Then you click on a portal row, which runs a script, sets IDs, etc.. It is not perhaps as smooth as a drop-down list. But drop-downs become slow and ugly with a lot of records, whereas a relationship is still fast, on networks and large files. I've used it with 10,000+ names; takes 3-4 letters to narrow it down.

The visible scripts must also check for Get (AllowAbortState); which is new to 7. Otherwise visible scripts have no way to Halt a currently running script, and still run themselves. Buttons to leave must stop the Loop, or it continues (not good). Best to severely limit the number of visible scripts.

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.