13 Replies Latest reply on Jul 7, 2015 1:46 PM by AndrewJudd

    Add multiple records to portal in a related table (from parent)

    AndrewJudd

      Title

      Add multiple records to portal in a related table (from parent)

      Post

      Hi all, I am trying to build a button with script to allow a user to easily flag selected records in "CLIENTS" and add them directly to a portal to "CLIENTS FOUNDSET LINE ITEMS" which is in the layout "CLIENT FOUNDSETS". 

      This will allow users to keep track of selected lists which appear in a portal in "CLIENTS" to "CLIENT FOUNDSETS". 

      I am only able at the moment to generate the lists from within the layout "CLIENT FOUNDSETS" using a popover to my client table with the attached script to add the clients (one by one) to the list. I'll include a picture of the relationships too. 

      It would be great to have any pointers. thank you! I'd rather keep my tables / relationships as they are if possible, as this does work well using the popover but to add the more direct option would be great.

       

       

       

      Screen_Shot_2015-07-07_at_10.27.16.png

        • 1. Re: Add multiple records to portal in a related table (from parent)
          AndrewJudd
          /files/c1607a6f4e/Screen_Shot_2015-07-07_at_10.18.33.png 763x282
          • 2. Re: Add multiple records to portal in a related table (from parent)
            philmodjunk

            I suggest that you describe in more detail what it is that you are trying to do here. You have quite a few table occurrences here but you don't describe the differences between nor the purposes of Clients vs Clients_Foundset vs Clients Foundset Line items.

            Nor do you explain what it is that you want to do but can't.

            Are Clients, Clients Foundset and Clients For Foundset all occurrences of the same table?

            • 3. Re: Add multiple records to portal in a related table (from parent)
              AndrewJudd

              Attached is a screen shot of my tables.

              I am trying to make it easier for a user to save foundsets of selected records (for longevity). So a user can flag a selection of contacts - say 100 people they want to be in touch with about something. I have a simplt flagging system in contacts, where they can flag and then find flagged to get a foundset.

              What I then want to be able to do is put those contacts in another related table where the foundset can be given a title and maye a date created. This is shown in a portal in a tab in clients so the user can easily see who is on what list. Image attached.

              What I have at the moment is fine but not the best possible - a user has to go to the layout "Client Foundsets" based on the table "Client Foundset". There they can search by name and add names to a portal list (Clients Foundset Line Items). This way a client can be on numerous lists.  image attached.

              What I would prefer to do is a user chooses their contact from the clients table as there they have multiple search options - say by address, purchase history, contact type etc etc. Make the flagged list. And then add to the portal list (Clients Foundset Line Items).

              Its a bit tricky to explain but hopefully that is it. I have exactly the same system in place for making a price list of artworks in my inventory. Maybe if we can work out the logic for the above I can then apply it to my artwork inventory. I'll include a larger pic of my relationships.

               

               

               

              • 4. Re: Add multiple records to portal in a related table (from parent)
                AndrewJudd
                /files/b7cc07c2ef/Screen_Shot_2015-07-07_at_18.33.30.png 777x553
                • 5. Re: Add multiple records to portal in a related table (from parent)
                  AndrewJudd

                  Portal in clients where you can see the related table list.

                  • 6. Re: Add multiple records to portal in a related table (from parent)
                    AndrewJudd
                    /files/e0bbe60ffa/Screen_Shot_2015-07-07_at_18.36.01.png 1433x635
                    • 7. Re: Add multiple records to portal in a related table (from parent)
                      philmodjunk

                      I think this is what you have:

                      Clients-----<ClientFoundSets-----<ClientFoundSetLineItems

                      So if I select 5 clients, say with IDs, 3, 5, 6, 20, and 500, Then I would create one record in ClientFoundSets, we'll call it "Smith Project" and then create 5 reords in ClientFoundSetLineItems with client IDs, the same already listed: 3, 5, 6, 20, and 500. To show full contact information for each lineItem record, you can add another Table occurrence of Clients named FoundSetClients to get:

                      Clients-----<ClientFoundSets-----<ClientFoundSetLineItems>----FoundSetClients

                      I haven't tried to replicate your names here, just added similar descriptive names as I've put this together.

                      Is this what you have in mind?

                      Are you using FileMaker 13 or newer? or some other version?

                      Edit note: Clearly you are using 13 or newer as I see a popover in one of your screen shots..

                      • 8. Re: Add multiple records to portal in a related table (from parent)
                        AndrewJudd

                        Hi yes 13. I think that follows yes. That sounds good. My script at the moment runs from the popover and adds a client one by one to the portal Clients Foundset Line Items. basically what I want to do is quickly add a foundset of records from Clients to that portal. I see this being a button on the Clients layout (say next to the foundsets portal) that adds them to the portal Clients Foundset Line Items and also takes you to the layout Client Foundset so you can put in the title of choice etc.

                        • 9. Re: Add multiple records to portal in a related table (from parent)
                          AndrewJudd
                          /files/8940a17d73/Screen_Shot_2015-07-07_at_18.54.30.png 764x745
                          • 10. Re: Add multiple records to portal in a related table (from parent)
                            philmodjunk

                            I originally asked about versions as FileMaker 13 has a new summary field that can return a list of all values from its specified field over the current found set. But upon further reflection, this is even easier and doesn't need that.

                            This is the user scenario that I am picturing:

                            Context is key.

                            You are on the Clients layout. After performing a find to pull up the set of clients records that you want to "Save" for future reference. This would involve four important details:

                            a) creating a new record in ClientFoundSets and entering an appropriate name or description for it.

                            b) Linking that one new ClientFoundSets record to one specific record in Clients. (This is actually the sticky part)

                            c) Creating a set of new records in ClientFoundSetLineItems with the IDs of your current found set. This is easily done with Import Records.

                            c) linking these new records to the new ClientFoundSets record. This can be done with a variable and Replace Field Contents.

                            That make sense so far?

                            That part that's tricky is the fact that you are on the Clients layout and you both one to pull up a found set of clients and also then link the IDs from that found set to one specific client, but your find to find those clients means that you no longer have a current record on the table with that information. You'd need to save that data in a variable or global field before performing a find or two to get your found set. Either that, or you'd use a drop down list or selection popover to select the client to which to link your new saved found set after you've pulled together the desired set of records.

                            • 11. Re: Add multiple records to portal in a related table (from parent)
                              AndrewJudd

                              That sounds great Phil. What's the first step? thank you

                              • 12. Re: Add multiple records to portal in a related table (from parent)
                                philmodjunk

                                I outlined more than one approach to handling how to link such a found set to a given client record.

                                Which approach makes more sense for what you want to do?

                                • 13. Re: Add multiple records to portal in a related table (from parent)
                                  AndrewJudd

                                  I think this is the one -

                                  So if I select 5 clients, say with IDs, 3, 5, 6, 20, and 500, Then I would create one record in ClientFoundSets, we'll call it "Smith Project" and then create 5 reords in ClientFoundSetLineItems with client IDs, the same already listed: 3, 5, 6, 20, and 500. To show full contact information for each lineItem record, you can add another Table occurrence of Clients named FoundSetClients to get:

                                  Clients-----<ClientFoundSets-----<ClientFoundSetLineItems>----FoundSetClients

                                  The one thing that worries me about the other one (the last one you put with 4 -a, b, c and d parts) is that it seems to suggest the foundset is linked to one client. I would need all clients on the foundset to be in the list. So the title of the foundset appears in a portal in each client. That way a user only has to remember one person on the list to find all the others. What I hoped I would be able to do is set this up a bit like how I have a button to put a foundset of artworks straight onto an invoice. I do this with the attached below script... I know something similar is not quite possible as a contact in clients needs to appear on multiple foundsets (hence the need for line items), but is there anything similar to this that would work?