2 Replies Latest reply on Oct 22, 2014 4:10 AM by dsr1

    Using Find with Multiple Criteria in a Single Field

    dsr1

      Hello All,

       

      I am struggling with a simple 'find" I wish to create via script.

       

      Consider a product file where one or more products is exclusive to a particular shop. One shop can sell the product, but the others should not even see it.

       

      The product table contains a field "Exclusive to" which will be empty for most records, but carry the Shop ID for the selected "Exclusive" shop.

       

      So I want users to see all products that are non-exclusive (empty), all products that are exclusive to the current user's shop and no products that are exclusive to other shops.

       

      Can "Find" do this in a straight forward manner?

       

      Thanks

       

      Peter

        • 1. Re: Using Find with Multiple Criteria in a Single Field
          erolst

          You would use

           

          * for all products exclusive to any shop

           

          = for all non-exclusive products

           

          a shopID for all products exclusive to that shop

           

          To search for different criteria in the same field, add a new request. Combining this:

           

          # on a shop layout

          Set Variable [ $shopID ; Shop::id ]

          Go to Layout [ Products ]

          Enter Find Mode

          Set Field [ Products::exclusiveTo ; "=" ]

          New Record/Request

          Set Field [ Products::exclusiveTo ; $shopID ]

          Perform Find

           

          You could also do this without a find by using a filtered relationship / portal.

          • 2. Re: Using Find with Multiple Criteria in a Single Field
            dsr1

            Thanks erolst,

             

            I did not realise that adding a new record in Find Mode was the way to get multiple criteria. I have read my training manual and consulted the help system many times, but I tend to see what I want to see... old dog new tricks.

             

            Your resonse is gold.

             

            Thanks again.

             

            Peter.