2 Replies Latest reply on Jun 23, 2010 10:14 AM by m10muhammad

    Script for matching data in one layout to another

    m10muhammad

      Title

      Script for matching data in one layout to another

      Post

      Version: FileMaker Pro 11

      OS: Mac OS X 10.6.2

       

      Background: My database is used for tracking printing machinery specifically relating to purchases, sales, inquiries, etc. There are three main tables: Contacts, Machinery, and Requests. The Contact table includes all of the people (customer, dealer) associated with the database. The Machinery table includes information on each machine either in stock at the company or available for purchase. The Request table has a form where customer's inquiries can be stored (i.e. they ask for specific make, model, and provide a budget). 

       

      Issue: What I want to do is create a script that, when run, will automatically see if the current record in the Request layout (i.e. a specific request made by a contact) matches with any of the machines in the Machinery table. So if the current record in the Request layout has the following info:

       

      Make : Komori

      Model: 3455-7

      Budget: $35000

       

      I would want the script to see if I have any machines in the Machinery database with the same Make, Model, and a price that is either at or below the budget. 

       

      Please advise as to how I can accomplish this task.

       

      Thanks in advance.

       

      Muhammad. 

        • 1. Re: Script for matching data in one layout to another
          ryan

          What about creating a self-join relationship with your Requests Table and setting Make = Make, Model=Model, and Budget ≤ Budget?

           

          then, via a Portal, you will be able to view any Requests that exist already matching that criteria.

          • 2. Re: Script for matching data in one layout to another
            m10muhammad

            Thanks for your quick response.

             

            My Machinery and Requests table are already related by means of a relational value list that doesn't have anything to do with this specific task. So when I tried to create a relationship between Category, Make, Model, etc. in the Machinery table to the corresponding fields in the Requests table, the error came up that I would need to make a separate table occurrence...

             

            So if I want to include a portal on each record in the Machinery layout which would list any Requests that match its information, and a portal on the Requests layout that would show any matching Machinery items, how would I do so? Would I need to create a new table occurrence of both the Request and Machinery table and then link the fields from RequestCOPY to Machinery and from MachineryCOPY to Request? Or is there something else that I need to do?

             

            Please advise.

             

            Thanks in advance.