Results 1 to 6 of 6

Thread: Omit records

  1. #1
    Join Date
    Apr 2006
    Posts
    5

    Unanswered: Omit records

    How can I merge the following conditions into a find request (within a script)?

    field1 = Get(ScriptParameter)
    AND field2 = 2
    AND field3 = >0
    AND field4 != 6 (this Filemaker does not support in find-requests...)

    The first 3 conditions I can find via
    Enter Find mode[]
    Set field ...
    Set field ...
    Set field ...
    Perform Search[]

    But I don't know how to add the fourth condition because "omit records" only works with PerformFind[Restore], which is incompatible with the first condition...

  2. #2
    Join Date
    Apr 2004
    Posts
    61

    Find and omit

    What's wrong with performing the find and then perfoming another omit within the same script? Don't forget to work within the current found set.
    We used to have to do successive finds in the same script. This should be no different.

  3. #3
    Join Date
    Aug 2005
    Location
    Minneapolis, MN
    Posts
    56
    Or do it in one Find with two requests:

    Enter Find Mode []
    Set Field [ field1 ; Get(ScriptParameter) ]
    Set Field [ field2 ; 2 ]
    Set Field [ field3 ; >0 ]
    New Record/Request
    Set Field [ field4 ; 6 ]
    Omit Record
    Perform Find []

  4. #4
    Join Date
    Apr 2006
    Posts
    5

    OMIT again

    Quote Originally Posted by chriscozi
    What's wrong with performing the find and then perfoming another omit within the same script? Don't forget to work within the current found set.
    We used to have to do successive finds in the same script. This should be no different.
    There are 2 ways of programming the find-request:
    1. Enter FindMode[] > SetField[...] > PerformFind[]
    2. Perform Find[Restore] //FindRequest specified within

    Now as I want to use Get(ScriptParameter) (for the first condition), I have to use way1.
    But for condition 4 I have to use way2 because saying "does not equal 5" only works with OMIT, and this only works with way2.
    Then I have to combine the two, which I cannot do via

    Enter FindMode > SetField[field1; Get(ScriptParameter)] > PerformFind[] > ExtendFoundSet[Restore] /where Restore is " OMIT field4 = 5 "

    because this would be an OR-search rather than an AND-search...

  5. #5
    Join Date
    Aug 2005
    Location
    Minneapolis, MN
    Posts
    56
    It is not necessary to restore the omit condition. See my above post.

    (Perhaps you're having trouble with the forum too? It seems to give me a different set of replies everytime I refresh it.)

  6. #6
    Join Date
    May 2006
    Posts
    7
    Quote Originally Posted by Jenny_Leipzig
    How can I merge the following conditions into a find request (within a script)?

    field1 = Get(ScriptParameter)
    AND field2 = 2
    AND field3 = >0
    AND field4 != 6 (this Filemaker does not support in find-requests...)

    The first 3 conditions I can find via
    Enter Find mode[]
    Set field ...
    Set field ...
    Set field ...
    Perform Search[]

    But I don't know how to add the fourth condition because "omit records" only works with PerformFind[Restore], which is incompatible with the first condition...
    Not sure exactly what you're trying to do, but I more or less agree with the other poster, since I just had to do something like this. However, I opted for a very clunky, but workable, scripting solution, which involved first getting my basic found set through a standard find. Then, I used a looping script to mark up the found set a certain way (to ID the records I wanted to omit); Then I used a second looping script to omit the records so marked.

    Again, clunky and a bit tricky to write; but, for my purposes, it worked fine.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •