2 Replies Latest reply on Aug 28, 2013 10:06 AM by skoubi

    Select from List Layout / Paste contents of related selection/record to another layout

    skoubi

      Title

      Select from List Layout / Paste contents of related selection/record to another layout

      Post

           Hi all !

            

           I'm new to filemaker and still trying to find my way around.

           What I have in my DB so far:

           Tables: Cust_Data (name,address,phone etc.)

                          Offer_PC (checkboxes linked with prices)

            

           What I want to do is: Before creating a new record to make a new pc offer, I want to select through a list layout the customer I want, and show the customer data in the Offer_PC layout, before proceeding to check the boxes.

           I have created a List layout (shows data from Cust_Data) and created a button from the available customers shown there. I tried to create a script attached to the button that copies the related record data to the Offer_PC layout (with or without a portal) but so far I haven't succeeded.

           Could you point me the right way on how to do such a select/copy script ?

           Thank you.

            

        • 1. Re: Select from List Layout / Paste contents of related selection/record to another layout
          philmodjunk

               Well I wouldn't necessarily copy any customer data if I were you. I'd link the new Offer_PC record to a specific record in Cust_Data via a relationship and then I can display that data. That said, sometimes you want to capture a copy of that data because you want to know what data for that customer was current at the time the offer was made and don't want it to change when a customer's contact info changes at a later date.

               Either way, the first requirement is to set up a relationship linking the two tables. FileMaker, after all, is a Relational database system.

               First add an auto-entered serial number field, __pkCustomerID to your .

               Set up this relationship:

               Cust_Data----<Offer_PC

               Cust_Data::__pkCustomerID = Offer_PC::_fkCustomerID

               For an explanation of the notation that I am using, see the first post of: Common Forum Relationship and Field Notations Explained

               Then a button on your Cust_Data layout can perform a script such as this:

               Set Variable [$CustID ; value: Cust_Data::__pkCustomerID ]
               Go to Layout [ "Offer_PC" (Offer_Pc ) ]
               New Record/Request
               Set Field [Offer_PC::_fkCustomerID ; $CustID ]

               That script creates a new record in Offer_PC and links it to the clicked Cust_Data record from the previous layout.

               Then see this link for a discussion of the two options (copy or link) for showing customer data on your offer pc layout: Auto Fill

          • 2. Re: Select from List Layout / Paste contents of related selection/record to another layout
            skoubi

                 Thanx a lot Phil, for your prompt and right on spot answer !

                 Edit:  Also the follow up link for autofilling the rest of the record data was very helpful ! Only difference was, I used merge fields to show the rest of the data.