March 8, 201114 yr Newbies 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
March 8, 201114 yr 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?
March 8, 201114 yr Author Newbies Thanks for pointing that out, by changing the placement of the new request prior to performing the find it now seems to work
Create an account or sign in to comment