Newbies aceman Posted November 27, 2006 Newbies Posted November 27, 2006 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
Genx Posted November 28, 2006 Posted November 28, 2006 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.
Newbies aceman Posted November 29, 2006 Author Newbies Posted November 29, 2006 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
Recommended Posts
This topic is 6571 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