7 Replies Latest reply on Jan 30, 2012 8:32 AM by philmodjunk

    Copying Layout into another database issue

    unitedbiologicsmattg

      Title

      Copying Layout into another database issue

      Post

      So I just combined two databases using This guide and, after some persistance and trouble shooting, got everything working except for one thing. The database is of Inventory parts and Purchase Orders (Started out as two databases because FMP wouldn't let me/I couldn't figure out how to use 2 different starter solutions without creating 2 separate databses), and it is pretty much just slight modifications to the starter solutions. Although, when trying to transfer over the "printable" PO form (called the "Purchase Order" layout in the starter solution), I can't get the form to distinguish between separate purchase orders. It is combining all the line items from all the purchase orders when I switch to that layout. 

       

      In both databases the "record detail" layout looks like this and seems to function flawlessly after the merge (except that all the line items on the old PO's didn't transfer, but that isn't that big of a deal and doesn't seem fixable). Note that this single PO lists these 8 items:

       

       

      Here is what the printable form (titled "Purchase Order" in the template) looks like in the original database. Notice how only the 8 line items from this specific PO are listed even though there are 140 total line items throughout all the records PO's. 

      Here is what happens when I switch to this layout in the merged database when looking at the first PO I screenshotted at the top (which had 8 items). 

      7003A21 is from 1 vendor and PO, while all the other parts from another Vendor and PO, and when I click on items from 1 PO all the header stuff changes to match from that PO. And then when I click on the records up top it shows a totally different record for the 8th line of PO 1706 which doesn't make any sense. 

       

      I have spent hours trying to figure this out and I'm pretty sure whatever is causing it is just beyond my knowledge of the program (although I'm sure it's probably an easy fix for you guru's out there). The guide was followed strictly and everything other than this seems to have worked fine. I looked up and down every aspect of the layout and line items that I am aware of, and everything looks identical between the two databases. If you guys have any suggestions anything would be appreciated. Thanks!

        • 1. Re: Copying Layout into another database issue
          philmodjunk

          It's not likely to be a difference in the layouts, but in the scripts used. This kind of print from the line items layout works with a script that pulls up the correct set of records on that layout at the same time you click the button to print it.

          Take a look at this very simple demo file that uses the same method for an example script on how to set this up:

          http://fmforums.com/forum/showpost.php?post/309136/

          • 2. Re: Copying Layout into another database issue
            unitedbiologicsmattg

            Wow, not sure what happened but it now seems to be operating correctly. I changed an error in what seemed to be an unrelated script; the "print purchase order" Script, and now the issue seems to be resolved. Very unusal as I was not using that script to view the purchase order, just selecting the different layout manually (probably something I just haven't figured out yet). The 1705 PO seemed to be corrupt, and may be an issue with all the PO's that were transferered from the old database, although I haven't examined it thoroughly nor is it too important. Thanks for your help Phil, the thread you linked will help with working with scripts in the future. 

            • 3. Re: Copying Layout into another database issue
              philmodjunk

              I was not using that script to view the purchase order, just selecting the different layout manually (probably something I just haven't figured out yet).

              That method doesn't update the found set of the print layout. When you ran the print script, it probably pulled up the correct line items for the current PO. This found set wilil remain in place and look correct when you change layouts manually until you change to a different PO, then it will still show the line items for the preivous PO.

              • 4. Re: Copying Layout into another database issue
                unitedbiologicsmattg

                So if i'm understanding correctly: the problem still exists, it just luckily showed up correctly this time? 

                • 5. Re: Copying Layout into another database issue
                  philmodjunk

                  That's my best guess, but a copy of the "print" script can be set up to view the correct line items, but with the print step removed so that you can view the records without printing anything.

                  • 6. Re: Copying Layout into another database issue
                    unitedbiologicsmattg

                    Okay so you were right about it not actually being fixed. Although the script you linked seems to be equivalent to the the script in the template, although slightly less complicated (there is some good. I triple checked the scripts and they all seem to be identical and with no errors.  I feel like it is a problem with the corrolation from the line items table into the PO's table when changing layouts. Do you have any other suggestions?

                     

                    edit: Or some kind of discrepancy when combining the scripts from the "inventory" template with the "purchase orders" template?

                    • 7. Re: Copying Layout into another database issue
                      philmodjunk

                      Both systems are set up on the same basic structure so I would expect the scripts to be very similar. I suggested the demo file as it's simplicity makes it easier to understand.

                      I'm not sure what the current status is here other than it's "still not fixed". I don't know what you have attempted to fix this. The key detail to keep in mind is that the two layouts are not automatically kept synchronized with each other. To see the correct set of records on the print invoice layout a script must be performed to find the correct records. If you just select the layout from the layout drop down, no script is executed so nothing happens to "synch" the two layouts with each other.

                      If you are attempting to use a script and not getting the records you expect, you need to do two things in order for me to suggest much to help you:

                      1) Post a description of the tables involved and how they are related. You can do this with a screen shot of Manage | Database | Relationships or you can use text in this format:

                      TableOccurrenceName::FieldName = TableOccurrenceName::FieldName

                      To list the relationships

                      2) Post the script you are attempting to use.

                      To post a script to the forum:

                      1. You can upload a screen shot of your script by using the Upload an Image controls located just below Post A Answer.
                      2. You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here.
                      3. If You have FileMaker advanced, you can generate a database design report and copy the script as text from there.
                      4. If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format. (Use the HTML option on the database tab panel and paste the text into the forum's HTML editor.)