Newbies barry Posted November 7, 2004 Newbies Posted November 7, 2004 hi, when you do a perform find from within a script and it finds no records, a dialog saying 'no records matching this set of find requests' appears, asking if you want to modify find, continue or cancel, i was wondering if it is possible to stop this dialog from appearing as if the continue option was selected, thanks, Barry
MoonShadow Posted November 7, 2004 Posted November 7, 2004 Yes. Add a Set Error Capture [On] before the find. This will stop the FM dialog but you will then need to trap and handle the error yourself; something like: Set Error Capture [ On ] Allow User Abort [ Off ] Enter Find Mode [ ] ... not always required with vs. 7 Perform Find [ ] If [ not Get(FoundCount) ] ... do whatever you wish (including message example next line) ... Show Custom Dialog [ OK; "No records found." ] Halt Script End If ... do whatever you wish with the found set ...
Newbies barry Posted November 7, 2004 Author Newbies Posted November 7, 2004 just what i needed, thanks for the quick response, Barry
Newbies Rowley Posted November 29, 2004 Newbies Posted November 29, 2004 That's pretty close to what I needed, too. I'm including a step in a script that checks first to see if a record with the same customer ID number already exists. If it does, then the script proceeds to create an order using the existing customer info. If it doesn't, then the script creates a new customer entry and then uses THAT to create a new order. The easiest way to do this seemed to be to go into Find mode, then if the Find comes up empty, (if I understand correctly), I can use a [not IsEmpty()] function to use existing field data... else create a new customer record and set the field data, then use that to go create a new order entry... right? But is there an easier way to do this than by using Find mode and an IsEmpty function? ...Like one of the other logical functions?
Fenton Posted November 29, 2004 Posted November 29, 2004 The problem is that pesky humans do not yet have reliable codes to identify themselves properly. So, you've got a Customer "Sam Smith," and now someone calling themself "Samual Smith" wants to place an order. What do you do? If you use a straight relationship on the name, it will fail. If you do a Find, on say the first few letters of the 1st and last names, you'll succeed, but may also find "Samantha Smith" and "Sam Smitheroo". Furthermore, as you've "found" :-), a Find creates some interface issues, such as changing the found set in Customers; but you can use a separate window in 7 to avoid that, if desired. Another method is a portal of matches, with a filter on the first letters of the last name (which is more reliable than the first name, due to things like "Richard-Dick, Robert-Bob," etc.); you could include some letters of the 1st name as "optional" (have to set up your multi-line keys to handle this). Show the results in a portal, optionally with whatever else you need to make a positive match: phone, city; either of which could be changed anyway :-( Either method works. The 2 basics: 1. Filter (or Find) and show the possible matches, with enough data to decide 2. Create navigation to show these and get back to the order, either assigning a Customer, or creating a new Customer, then assigning. (The latter "New Customer" often requires a dedicated layout, with a big "Assign to Order" kind of button. You don't want that button on your regular Customer layout, because you don't know what order you'd be setting.)
Recommended Posts
This topic is 7302 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