argnom Posted May 12, 2008 Posted May 12, 2008 Hello, I'm having a bit of an issue with a script I'm currently working on. In my customer database, I added some fields related to callbacks for trouble tickets. Time (drop-down list so that nobody can screw the format up), date (drop down calendar) and whom the ticket is assigned to (email address of employee, drop-down list again for the same reasons). This script will run several times a day and should accomplish the following: 1. Check if the field (CallBackDate) contains today's date 2. Send an email to the email address of the person the ticket is assigned to with some details (customer name, phone number, time of callback, a copy of the customer's log file etc). 3. All done! Now, oddly enough, it's not the step 2 that causing me problems, (yay!) it's step one. For some reason, probably because I'm using a drop-down calendar, I cannot seem to make a find of the records that contain today's date. Go to Layout [ “Data Entry” (test) ] Show All Records Go to Record/Request/Page [ First ] Perform Find [ Specified Find Requests: Find Records; Criteria: test::CallBackDate: "//" ] [ Restore ] Same goes if I try to find it manually. If I perform a find directly in browse mode for "//" in the date drop-down calendar field, I get nothing. If I perform a find selecting today's date in the calendar in browse mode, it works. Any solutions/brilliant workarounds guys/girls? Thanks
bcooney Posted May 12, 2008 Posted May 12, 2008 I think you'll need a script that does this pseudo-code: Go to Layout (based on TO of Tickets) Enter Find Mode Set field Call Back to Get (currentdate) Set field Completed_Date to "" Perform Find Go to Record First Loop if (not isempty ( personemail)) Send Email to first person endif Go to Next Record (Exit after last) End Loop
LaRetta Posted May 12, 2008 Posted May 12, 2008 (edited) It should work fine even with dropdown calendar. Try dropping the quotes; you are specifying literal text [color:green]of "//" with the quotes. In fact, Perform Find [ Restore ] only accepts literal text anyway and wraps it with quotes itself. If it doesn't work without the quotes then you have a problem elsewhere (for instance, are you searching another table which isn't related?). LaRetta Edited May 12, 2008 by Guest Added green
LaRetta Posted May 12, 2008 Posted May 12, 2008 It appears that you go to table occurrence called Test originally, and you are performing the find on field from same table so un-related isn't your issue. In truth, I couldn't even understand how FM would accept your "//" in a Perform Find (Restore). Oh well, maybe Barbara nailed it for you. One more thing just in general ...You do not need to perform a Show All Records nor a Go to Record/Request/Page [ first ] before a Find. Nor do you need to perform the Go To Record/Request/Page [ first ] AFTER the perform find because you will always be placed on the first record afterwards. LaRetta :wink2:
mr_vodka Posted May 12, 2008 Posted May 12, 2008 (edited) The drop down calendar option shouldnt really have anything to do with it. You dont really need to show all records or need to go to the first record as well. You should be able to do with with a Perform Find [Restore] where the stored criteria is: Field - test::CallBackDate Criteria - // (no quotes) If not, you can always try Enter Find Mode [] Set Field [ test::CallBackDate; Get ( CurrentDate ) ] Perform Find [] * Edit: I am a little slow on the draw. Listen to those two wise women in front of me... ;) Edited May 12, 2008 by Guest Slow Draw
argnom Posted May 12, 2008 Author Posted May 12, 2008 Thank you for all the quick replys. Unfortunately, none of your suggestions seem to work. Fortunately, I think I found the problem. It seems that all the dates in my database are in dd/mm/yyyy format and the date from the drop-down calendar is in mm/dd/yyyy. I think I just need to fix this up to get it to works. I'll keep you posted. Thanks again! Nice to see you again Mr_Vodka
comment Posted May 12, 2008 Posted May 12, 2008 It should work the way you have it - provided that CallBackDate is defined as a Date field.
argnom Posted May 12, 2008 Author Posted May 12, 2008 (edited) Well, huh, yeah, well... It seems it was my bad all along people. Comment's reply got me thinking. For my defense it's monday... ok? It seems that I forgot [color:red]one tiny minuscule little detail when I created the drop-down calendar field. I did not specify that it was a [color:red]date field... oops. The problem was 18 inches from the monitor this time. Thank you for fixing the user! Problem solved Go to Layout [ “data entry” (test) ] Show All Records Perform Find [ Specified Find Requests: Find Records; Criteria: test::CallBackDate: “//” ] [ Restore ] [color:gray]Show all records may not be necessary but it makes me feel safer :P Edited May 12, 2008 by Guest Added the code
comment Posted May 12, 2008 Posted May 12, 2008 Good. You should still delete the Show All Records and Go to Record/Request/Page steps, as they don't really do anything when followed by a find.
Recommended Posts
This topic is 6388 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