1 2 Previous Next 16 Replies Latest reply on Jan 25, 2015 6:47 AM by philmodjunk

    Merge portal record and record to letter

    StefanSaeys

      Title

      Merge portal record and record to letter

      Post

      I have two tables: companies and contacts. On the companies layout I've created a portal to contacts (one to many). I've also created a layout "Print Letter" and used merge fields to place the data from Companies and Contacts. The contents of the companies record matches, but the one that is in the portal doesn't.

      The button to "print letter", located on layout companies contains the following: 
      Go to Related record [Show only Related Records; From table "companies"; Using layout <Current Layout>]
      Go to Layout ["Print Letter" (companies)]
      Print [Restore HP Color LaserJet Pro]

       

      Thx for any suggestions
       

       

        • 1. Re: Merge portal record and record to letter
          SteveMartino

          Hard to tell with your brief description, but what exactly is printing/not printing.  It's possible either the print layout is from the wrong context, or the GTRR step is wrong.  It would seem to be to be incorrect to show the related records from contacts on the same layout as companies, when contacts is a different table/table occurance.

          When you go to the "Print Letter" layout, do you expect to see all the contacts in the merge field?  You may need a merge field that is a calculation that lists all the related contacts.

          • 2. Re: Merge portal record and record to letter
            StefanSaeys

            The letter is printed but some of the content is wrong (from the merged fields); the data from the portal doesn't match the data in the portal's record.
            Data that is on the same layout matches on the letter.
            I would like to see one letter with one company address and one contact. But I would also like to offer the possibility to have multiple companies (and their relevant contacts) after a search. So there will be 2 buttons to achieve this.

            And on top of this, if more than one contact is present (for example 3) , I would like to end up with 3 letters addressed to the same company, but with 3 different contacts).

            Hope this makes some sense :-)

            • 3. Re: Merge portal record and record to letter
              SteveMartino

              The letter is printed but some of the content is wrong (from the merged fields); the data from the portal doesn't match the data in the portal's record.
              Data that is on the same layout matches on the letter.

              Hard to tell without a sample file, but you may need to print your letter from the context of Contacts and not Companies  If your letter layout is from Companies, you may only get one contact record per letter. However, if your layout is from Contacts, you will most likely get one letter for each contact, related to the company.

              Also, the relationship, sort or filter in the portal might be tripping you up.  If your relationship is sorted one way, and your portal is sorted/filtered, you will get the wrong data.

              If you can post a sample file with some dummy records that replicate your dilemma, it would be easier to help.  I don't have Phil's Jedi mind.  I just can't picture things the way he does. :)

               

              • 4. Re: Merge portal record and record to letter
                philmodjunk

                Sounds like you need to do a GTRR that specifies the contacts table rather than the company going to a layout based on contacts but including merge fields from company. That will isolate a specific contact but still link the the correct company data.

                • 5. Re: Merge portal record and record to letter
                  StefanSaeys

                  I've placed a dummy file at http://www.saeys.org/test.fmp12.zip

                  The button is located on the companies layout. I would like to see one letter printed when there is only one contact in the portal (as there is in record 2).

                  Later on, I would like to have a second button, that generates a letter for all records in my search result.

                  • 6. Re: Merge portal record and record to letter
                    philmodjunk

                    Did you try what I suggested?

                    If you have:

                    Companies----<Contacts   ( one company record can match to many contacts )

                    Then you should set up your form letter layout with Contacts selected in the "show Records from" drop down in Layout setup.

                    You can use Go To Related records if you put the button for that inside the portal row of a portal to contacts on your companies layout. This will isolate a single contact corresponding to the row where you clicked the button. The above relationship allows you to include data from Companies on this layout as well as data from the selected contact record.

                    • 7. Re: Merge portal record and record to letter
                      StefanSaeys

                      Yes, but it always returns the same record in my print preview. My table companies is the parent, contacts the child. I've changed the related table of the letter layout to contacts and placed the button on the portal row. The button is being automatically duplicated in the second row. The print result always brings me the data from the last record in contacts.

                      • 8. Re: Merge portal record and record to letter
                        philmodjunk

                        In Preview mode, you'll see all records in your found set starting with the first record in that found set. This is expected behavior for preview mode. In Browse mode you should see the data from the record clicked. And if you print or save as PDF while specifying the "current record" option, you should get the letter with data from the record you clicked as well.

                        • 9. Re: Merge portal record and record to letter
                          StefanSaeys

                          In browse mode it shows me the last record from contacts (4/4), in preview mode the first (1/?).
                          It automatically starts in browse mode.

                          • 10. Re: Merge portal record and record to letter
                            philmodjunk

                            This is a method I use frequently with no trouble. Showing the "last record" makes no sense at all. Have you set up any script triggers on the layout where you have set up your form letter? That seems unlikely but when you get an unlikely result...

                            And this is a portal to contacts placed on a company layout? And when you are in layout mode and move the portal a few pixels, the button moves also?

                            Compare your design to this simple example: https://dl.dropboxusercontent.com/u/78737945/PortalGTRRdemo.fmp12

                            • 11. Re: Merge portal record and record to letter
                              StefanSaeys

                              Found it! On the button inside the portal I didn't specify the correct layout in "Show record using layout". It should be "print letter" instead of layout.
                              Thank you both for all the help!

                              • 12. Re: Merge portal record and record to letter
                                StefanSaeys

                                one more question; what if my search result returns more than one company? How do I send the letter to the companies and all their related portal contacts?

                                • 13. Re: Merge portal record and record to letter
                                  StefanSaeys

                                  If I create a new database it works. But it seems impossible to get it working on my actual database. Whatever I try it doesn't work.

                                  I've placed a mini version of the original database online: https://www.dropbox.com/s/96f8pxek0n5j9mi/properties.fmp12?dl=0
                                  Starting point is property, when clicking on the button in the row's portal it shows the correct FirstName LastName but the Property's Street/Town isn't updated.


                                  Any help greatly appreciated.

                                  • 14. Re: Merge portal record and record to letter
                                    philmodjunk

                                    If if work for a new database but not the original, check the fields that auto-enter serial numbers or other values. If you add an auto-enter option to a table previously created records will not automatically auto-enter a value. You'll need to use a tool such as replace field contents to update the existing records with the auto-entered data.

                                    1 2 Previous Next