2 Replies Latest reply on Apr 28, 2017 7:03 AM by philmodjunk

    Perform dynamic find

    luis.ecohaus

      Hi all,

       

      I am trying to script a "find" operation taking into account several criteria. I believe it might be easier to understand providing a practical example.

      • I have two deals: Joe Bloggs and Katie Bloggs. Joe Bloggs belongs to sales person A and Katie Bloggs belongs to sales person B.
      • Each deal contain fields describing the relationship between the deal and respective sales person:
        • each deal has the sales person foreign key and the sales person name (as a calculation).

       

      The goal is: sales person A is logged in and tries to search for a deal using a search field. By typing "Bloggs" it should only appear the respective deal (Joe Bloggs) and not both of them.

       

      I am using Quickfind for my searches. It works fine for a admin user because it can access everything. However, I don't want "sales team" users to look at other sales person deals.

       

      I looked at the FM Training Series: Advanced manual and they advise using "Dynamic Finds" (page 433 of the book by the way) by entering in Find mode and enter the search criteria using the Set Field script step. Still no luck.

       

      Did anyone came across with something similar?

      Thanks in advance.

        • 1. Re: Perform dynamic find
          Jason Wood

          luis.ecohaus wrote:

           

          I looked at the FM Training Series: Advanced manual and they advise using "Dynamic Finds" (page 433 of the book by the way) by entering in Find mode and enter the search criteria using the Set Field script step. Still no luck.

          The "search criteria" they are referring to would be in this case the sales person foreign key. To use this with a quickfind, you'd want to do a "constrain found set" script step after you perform the quick find.

           

          If you want to absolutely prohibit access to deals not owned by the current sales person, you should also set this up in Accounts & Privileges (record access).

          1 of 1 people found this helpful
          • 2. Re: Perform dynamic find
            philmodjunk

            Quick find might not be the method to use.

             

            A scripted find can specify both information about the current user and the name for which you are searching.

             

            Here is a discussion listing many scripted find examples:

             

            Scripted Find Examples

             

            A search portal could be used, either user specific info can be included in the portal's filter or as a match field in the relationship to limit the list of matching items to those that apply to the current user only.

             

            You can find working examples of different search portals and other method in the following file along with detailed documentation on each method:

             

            Adventures in FileMaking #1--conditional value lists

            1 of 1 people found this helpful