Newbies Ken Ball Posted May 5, 2011 Newbies Posted May 5, 2011 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
bcooney Posted May 5, 2011 Posted May 5, 2011 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.
Fitch Posted May 5, 2011 Posted May 5, 2011 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.
comment Posted May 6, 2011 Posted May 6, 2011 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
Recommended Posts
This topic is 4951 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now