May 12, 200817 yr 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
May 12, 200817 yr 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
May 12, 200817 yr 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, 200817 yr by Guest Added green
May 12, 200817 yr 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:
May 12, 200817 yr 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, 200817 yr by Guest Slow Draw
May 12, 200817 yr Author 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
May 12, 200817 yr It should work the way you have it - provided that CallBackDate is defined as a Date field.
May 12, 200817 yr Author 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, 200817 yr by Guest Added the code
May 12, 200817 yr 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.
Create an account or sign in to comment