November 27, 200619 yr Newbies Hi all, I need a smidge of advice. I am hoping to add a script to my client database. Here is what I would like to happen. I open fm, the script runs. The script performs a find looking for all records in the 'reviewdate' field that either = todays date or are anywhere between todays date and seven days into the future. When it has located these records I want the script to copy the data in the 'review notes' field into an email for each record found. I have so far worked out how to do the find and how to paste the data found into an email for each record. However the trouble I am having is getting it to only select dates within that 7 day period and if the dates don't fall in that seven day period I don’t want it to do anything. I guess it would also be a good function for it to ignore any records that have previously been emailed. As you can probably tell FM is new to me. I am doing ok but this seems intricate. Regards, Drew
November 28, 200619 yr You want to do a range search So just use: Freeze Window Allow user abort[Off] Set Error Capture[On] Set Field[ yourdatefield ; Get(CurrentDate) & "..." & Get(CurrentDate) + 7 ] Perform Find[] If[ Get(LastError) <> 0 ; ..Show Custom Dialog[ No Records Found ; No Records Found ; Ok, Cancel ] #Do Whatever you want here Exit Script[] End If #Rest of your script here Now keep in mind, that some of the functions may not be called the same thing in FM 5 (can't help you there) but the concept should be the same.
November 29, 200619 yr Author Newbies Thanks, I am an 8.5 user now. Need to update my profile. Will test this today and let you know how it goes. Drew
Create an account or sign in to comment