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 sorting question

Featured Replies

  • Newbies

I have a script that finds sales based on date or salesman or both with search string done via custom dialogue input fields.

I would like to sort by salesman and date if both fields are inputted, but only by date if only date is queried.

Is there a script step that would allow me to determine whether one of the search fields is empty?

Thanks

ken

If you are using a custom dialogue for your criteria input, then you know if they've specified a date or salesperson or both. So, your Find script can branch accordingly. Perhaps I've missed something...when you say custom dialogue, what do you mean? To me it means a layout that the user is taken to at the start of your script. This layout has two global fields, a date field and a text field.

I have a script that finds sales based on date or salesman or both with search string done via custom dialogue input fields.

I would like to sort by salesman and date if both fields are inputted, but only by date if only date is queried

If( IsEmpty( salesman ))

  Sort(by date)

Else

  Sort(by both)

End If

Don't forget that FileMaker custom dialogs are really dumb: the input fields are only processed if the user clicks the default button.

If I read this correctly, the custom dialog is presented in Find mode. So it should go something like:

Enter Find Mode[]

Show Custom Dialog [...]

Set Variable [ $s ; not IsEmpty [ YoutTable::Salesman ]

Perform Find[]

If [ $s ]

  Sort [by both]

Else

  Sort [by date]

End If

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.