Jump to content

Omitting Records from a found set


This topic is 4354 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • 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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This topic is 4354 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.