March 20, 200223 yr Newbies How do I require that 2 or more fields be filled in a search request. I am trying to secure customer records by requiring either invoice # and zip code or last name and zip code. I can not seem to find documentation of this kind of setting. Help?
March 20, 200223 yr Script the Find process. It'll look something like this... code: Enter Find Mode [pause] Perform Find [] In between these two steps you can perform checks to ensure that the find request has an entry... code: Enter Find Mode [pause] If [isEmpty(Invoice Number) or IsEmpty(Zip)] Beep Show Message ["Enter an Invoice # or Zip code.", OK] Enter Browse Mode [] Exit Script End If Perform Find [] ...if the Invoice Number or Zip fields have no search criteria entered the script beeps, shows the message then exits the find process. You could make it a bit nicer (and significantly more complicated) by making the script loop until a zip or invoice number is enetered into the find request. It'd look like this... code: Enter Find Mode [pause] Loop If [isEmpty(Invoice Number) or IsEmpty(Zip)] Beep Show Message ["Enter an Invoice # or Zip code.", OK] Else End Loop If [1] End If End Loop Perform Find [] Of course, it'd be a good idea to give people a way to cancel out of the loop... code: Enter Find Mode [pause] Loop If [isEmpty(Invoice Number) or IsEmpty(Zip)] Beep Show Message ["Enter an Invoice # or Zip code.", OK, Cancel] If [status(CurrentMessageChoice) = 2 Enter Browse Mode [] Exit Script End If Else End Loop If [1] End If End Loop Perform Find []
March 20, 200223 yr Author Newbies Thanks Vaughan for your help! In scripting this I find that I am not able to find End Loop If [ ] in my script options. I am on filemaker 5.0. Also I am getting automatic " " around any entry into the if and show message steps. Am I dim or what? Thanks
March 20, 200223 yr Another approach is to have a 2nd layout ("search") from which to perform the find and which displays just the fields you want included. Write a script which is activated from a button. Go to Layout ["search"] Enter Find Mode [Pause] If [isEmpty(Invoice Number) or IsEmpty(Zip)] Beep Show Message ["Enter an Invoice # or Zip code.", OK, Cancel] Go To Layout ["search"] Enter Find Mode [pause] End If <comment, format a button on the "search" layout to "resume script"> Perform Find [] If ["Status(CurrentError) = 401"] Go to Layout [] <comment, you make a navigation choice if no records are found> Else If["Status(CurrentFoundCount) = 1"] Go to Layout [] <comment, you make a navigation choice if only one record is found> Else If["Status(CurrentFoundCount) > 1"] Go to Layout [] <comment, you make a navigation choice if more than one one record is found> End If End If End If [ March 20, 2002, 03:48 PM: Message edited by: Keith M. Davie ]
March 21, 200223 yr quote: Originally posted by mark: Thanks Vaughan for your help! In scripting this I find that I am not able to find End Loop If [ ] in my script options. I am on filemaker 5.0. Also I am getting automatic " " around any entry into the if and show message steps. Am I dim or what? Thanks "Exit Loop If" is the script step that gets you out of a loop. Regarding the quotation marks, don't worry about them; they show up in the script step to show you what the "If" statement or "Show Message" is.
March 21, 200223 yr Author Newbies Keith, Thanks so much it worked. I am going to try to add the last name field as an alternate to the invoice # is the customer does not have their receipt. Thanks again!
Create an account or sign in to comment