Newbies TweakSF Posted March 8, 2011 Newbies Posted March 8, 2011 Hi All, I am really new to FMP development and have run into a problem with one of my scripts. I have a script that searches record date ranges in the database and I need to be able to omit records that are within certain parameters. The parameters are taken from a drop down table. I have tried several different approaches and now the script seems to be generating new records?! the script I have is as follows Set Error Capture [ On ] If [ IsEmpty ( Inventory::Start Date ) ] Show Custom Dialog [ Title: Inventory::Start Date; Message: "Start Date must have a value. Please reenter"; Buttons: “OK”, “Cancel” ] Exit Script [ ] End If If [ IsEmpty ( Inventory::End Date ) ] Show Custom Dialog [ Title: Inventory::End Date; Message: "End Date must have a value. Please reenter"; Buttons: “OK”, “Cancel” ] Exit Script [ ] End If If [ Inventory::End Date < Inventory::Start Date ] Show Custom Dialog [ Title: "End Start"; Message: "Hey Silly the Past is Not the Future try again!"; Buttons: “OK”, “Cancel” ] Exit Script [ ] End If Enter Find Mode [ ] Insert Calculated Result [ Inventory::Shot_Completed; Inventory::Start Date & "..." & Inventory::End Date ] [ Select ] Perform Find [ ] New Record/Request Set Field [ Inventory::Shot_Status; " = NotShot or Killed " ] Omit Record Constrain Found Set [ ] If [ Get ( FoundCount ) = 0 ] Show Custom Dialog [ Title: "Alert"; Message: "You have no records for this date range"; Buttons: “Close” ] Exit Script [ ] End If If[Get(FoundCount) >1] Go to Layout [ “Record List” (Inventory) ] Exit Script [ ] End If Sorry for the long post I am at wits end right now and any help would be greatly appreciated
comment Posted March 8, 2011 Posted March 8, 2011 now the script seems to be generating new records?! Well of course it does: ... Perform Find [ ] New Record/Request ... After performing the find, you are in Browse mode. Can you explain, in plain language, what are you trying to find?
Newbies TweakSF Posted March 8, 2011 Author Newbies Posted March 8, 2011 Thanks for pointing that out, by changing the placement of the new request prior to performing the find it now seems to work
Recommended Posts
This topic is 5009 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