1 2 Previous Next 15 Replies Latest reply on Feb 9, 2017 3:15 PM by tleitzke

    Get field from record by key ID

    tleitzke

      I have a key ID stored in my database (by conditional drop-down's). The Key ID is from another table in my project, and is unique by serial. I have been searching on Google for 2 days now, and I only come up with "perform find"- which is not what I want. I need to set a field from the key ID as unique connection(automatized).

        • 1. Re: Get field from record by key ID
          Jaymo

          Can you clarify what you are trying to accomplish? A "unique connection (automated)" is not very clear. Thanks again.

          • 2. Re: Get field from record by key ID
            tleitzke

            I need to set a field from a record on another table, which I have the unique ID(set by "Auto-enter Serial") for that record to grab the field from.

            • 3. Re: Get field from record by key ID
              siplus

              I feel a great disturbance in the force.

              • 4. Re: Get field from record by key ID
                Jaymo

                Are you trying to Set Field across a relationship? Try this:

                 

                Set Field [MyRelationship::MyField; Random]

                 

                The calculation can be anything you want. I just used the Random function to make it easy to follow.

                • 5. Re: Get field from record by key ID
                  tleitzke

                  The ElectricalContractor::PointOfContact holds the unique ID from Contractor_VALUES::ID by using conditonal values , so there isn't a direct relationship connecting ElectricalContractor::PointOfContact and Contractor_VALUES::ID. I have been searching for how to grab contractor_VALUES::Email/CC Email from Contractor_VALUES in a script and set it to Electrical_Contractor::ContactEmail/CC Email.

                  Capture.PNG

                  • 6. Re: Get field from record by key ID
                    Jaymo

                    Is that a one-to-one relationship between Company and Business? You need something that uniquely identifies the contractor in the contractor values to move data across accurately.

                    • 7. Re: Get field from record by key ID
                      tleitzke

                      I do, each contractor has their own unique ID(called ID)... like I said in every reply so far...

                       

                      The relationship above is used to correctly do conditional value lists- So in the form, I can use dropdown 1 to select business/company, the dropdown 2 I select the person from that business (which is where that unique ID, ID, is stored)

                      • 8. Re: Get field from record by key ID
                        philmodjunk

                        Click Contractor_values in your relationship graph to select it.

                        Click the duplicate button (2 plus signs)

                        Now relate this new occurrence of Contractor_Values to Electical_Contractor by the PointOfContact field.

                        You can now reference any data in Contractor_values by referring to the new occurrence that you just created and linked.

                         

                        Note that you have not duplicated the table. You have just duplicated a table occurrence so that you have two different ways to refer to and relate to the same table.

                        • 9. Re: Get field from record by key ID
                          tleitzke

                          I have that relationship set of (PointOfContact = ID), but I do not know how to actually know (or can figure out) how to use that. I tried this, but it didn't work (set to script using "OnObjectExit" for the drop down that gets the ID):

                           

                          Set Field [Electrical Contractor::Contact Email; Contractor_VALUES 2::Email]

                           

                           

                          EDIT:

                          It works now. I did not realize that you said to use the original relationship and not the one just made. So this creates the right results. Thank you so much. I have found NOTHING relative to this at all from google search over the past 2 days.

                           

                          Set Field [Electrical Contractor::Contact Email; Contractor_VALUES::Email]

                          • 10. Re: Get field from record by key ID
                            philmodjunk

                            That should work, but you don't need a script to do this. Use auto-enter field options--either a looked up value or an auto-enter calculation.

                            • 11. Re: Get field from record by key ID
                              philmodjunk

                              It should NOT work as the relationship to Contractor_VALUES is all wrong for matching to the contractor you have selected in the drop down. That relationship will match to the first contractor for the company selected in the first value list.

                               

                              Use either auto-enter options as I've suggested or just add these fields from the Contractor_VALUES 2 table occurrence directly on your layout.

                               

                              The first option copies your info. If you later edit the email address in the values table, the email in the electrical contractor table will not change. The second method will always show email address currently entered in the values table for the selected contractor.

                               

                              I have found NOTHING relative to this at all from google search over the past 2 days.

                              There's quite a bit of information out there on this but presumably you didn't use the right search terms. I suggest that you invest some time in some of the many good training materials on FileMaker to improve your overall understanding of relational data base design and FileMaker.

                              • 12. Re: Get field from record by key ID
                                tleitzke

                                It oddly does work- and only work- when I use the first relationship and not the second...

                                 

                                I used very simple and concise searches similar to "Filemaker set field to record by ID" or "filemaker set field to record by key id"- which is the simplest form to state this as.

                                 

                                 

                                Here is the entire thing( I removed the email line of "send electrical pdf" and "send airtest pdf". Yes I know, but idea to use information like that without temporary variables or password protected; but this is only for 2 peoplee to use who have legal access to the account). I have tested it, and it all works (although, it annoying only shows the ID number when contractor is selected in both forms).

                                • 13. Re: Get field from record by key ID
                                  philmodjunk

                                  You misunderstood my instructions. I directed you to make a new occurrence ONLY of Contractor_values to link back to the same table occurrence of Electrical contractor that you already have. Your current setup will not show the correct email address unless you just happen to get lucky and select the first related contractor for the selected company.

                                   

                                  CVLcontractorRelationships.png

                                  • 14. Re: Get field from record by key ID
                                    philmodjunk

                                    I think that you might find this tutorial useful:

                                     

                                    Tutorial: What are Table Occurrences?

                                     

                                    And I'd guess that your search terms while simple, were too specific. A few hours reading or watching some training materials on FileMaker and Relational database design would probably have been a better use of your time.

                                    1 2 Previous Next