1 2 Previous Next 17 Replies Latest reply on May 28, 2014 1:24 PM by hanstrager

    Help to set up a 'Master slave'...

    hanstrager

      Title

      Help to set up a 'Master slave'...

      Post

           I have a problem, I seem not to be able to solve and not sure what I'm doing wrong.

           I have a database, which makes technical descriptions for garments. My problem is when it comes to make washing instructions for the garments. You need to compare the different washing instructions for each fabric which are specific to each garment.

           I have been looking into PhilModJunk's tutorial: http://forums.filemaker.com/posts/e47206816d and Guy Steven tutorial on youtube: https://www.youtube.com/watch?v=VJqA03X33DQ

           So far I have the table 'TECHNICAL SHEET 2' Which is table for the specific garment.

           Then I have 'Fabrics' which is my table for fabrics, which are chosen chosen for the specific garment in 'TECHNICAL SHEET 2'

           Last I have 'Washing instructions' which is my table where I have the washing instruction icons, which is chosen for the specific fabric in my Fabrics table.

           I need to have a print layout where I can print all my garments in my database - each garment separate, with their specific fabrics and the fabric's specific washing instruction icons.

           Sofar I have a layout in list view based on TECHNICAL SHEET 2 with a portal showing all my fabric specific to a garment (portal1). 2 other portals (Portal 2+3) which should first show first wash instruction icon, and then the 2nd wash instruction icon specific to the fabric.

           Portal 1 is showing related records from 'Line Items Fabric' and has a button on it (When everything is working I hope to loose this button so everything will go automatically) with the following script attached:

           Set Field[TECHNICAL SHEET2::Selected Children; Line Items Fabric::FabricID_FK]

           Commit Records/Requests[]

           Portal 2+3 are showing related records from Line Items Fabric and has a container field Selected granchildren::Icon - which is the picture of the washing icon.

           When i push the 'test' button nothing happens in portal 2 or portal 3, but my Selected Children field shows different numbers according to the fabric...

           What am I doing wrong..?

      Screen-Shot-2014-05-16-at-18.24.32.jpg

        • 1. Re: Help to set up a 'Master slave'...
          philmodjunk

               Your screen shot shows that you did not do the recommended changes I posted in your original thread.

               You have three portals to the same table occurrence: Line Items Fabric.

               The left hand portal should be to Line Items Fabric

               The two portals on the right, that should be set to just one portal row if you are trying to set up a horizontal portal, should be based on Selected Grand Children

               And if you refer back to the original thread, I pointed out that we needed a different relationship between Technical Sheet 2 and Selected Grandchildren in order to ge this to work. You need a join table between the two table occurrences.

          • 2. Re: Help to set up a 'Master slave'...
            hanstrager

                 Not sure if this is the connection you're refering to?

                 Does TECHNICAL SHEET 2::Selected Children need to be number field with automated serial number..?

                 From what occurrence should the Icon field in my right hand side portals refer to..? Currently it's Selected grand children::Icon

            • 3. Re: Help to set up a 'Master slave'...
              philmodjunk

                   Did my last post to that thread not appear? I spelled this out there.

                   You need to position a new occurrence of Line Items Washing Ins. between Technical Data Sheet 2 and Selected Grand Children. The Selected Children field needs to match to a field in that new occurrence instead of directly to Selected Grand Children.

                   Contrary to a previous post that I made in that thread, your set field step needs to be this:

                   Set Field [ Technical Data Sheet 2::Selected Children ; Fabrics::xFabric_ID ]
                   Commit Records

                   And yes, apologies for the fact that you had the correct set field step earlier (it's the relationship that we needed to change).

              • 4. Re: Help to set up a 'Master slave'...
                hanstrager

                     I’m So sorry about this mess up, didn’t get the bit what you meant with a joint table… Still practicing my Filemaker skills.

                      

                     I change my relationships, is this correct now?

                      

                     And changed my script to:

                     Set Field [ TECHNICAL SHEET 2::Selected Children; Fabrics::xFabric_ID ]

                     Commit Records/Requests

                      

                     But it’s still not working – so still doing something wrong.

                     Does TECHNICAL SHEET 2: Selected Children need to be a number field with an auto enter serial or not..?

                • 5. Re: Help to set up a 'Master slave'...
                  philmodjunk

                       Selected Children should not be an auto-entered serial number.

                       The match field is wrong for the added occurrence of the join table.

                       Selected Children should match to Fabric ID_FK, just as Fabrics::xFabric_ID matches to Fabric ID _FK where the other occurrence of this join table is set up.

                  • 6. Re: Help to set up a 'Master slave'...
                    hanstrager

                         It's now working, sorry for me being so thick.

                         Is it possible to when you press the button on the right hand side the left hand side portals will then only show the care icons relevant to the fabric..? at the moment it shows the the care label for the fabric where the button has been pressed all the way down..?


                         if above is possible, is there then also a way, when I see the layout in list view, that I only have to press one button, or better a scrip trigger on my layout that will automatically show all icons for all fabrics for all different garment, so I don't have to press all the fabrics for all my garments before printing.

                    • 7. Re: Help to set up a 'Master slave'...
                      philmodjunk

                           This set up is designed to produce a single horizontal row of icons for just the selected fabric in the first portal.

                           That's not what I was suggesting that you set up. Portal 2, portal 3 and Portal 4 would be one row portals. Portal 2 would have an initial row set of 1, Portal 3 would have an initial row set at 2 and Portal 4 would have an initial row set at 3.

                            

                      • 8. Re: Help to set up a 'Master slave'...
                        hanstrager

                             I'm not sure I Understand you correct..? That with this set up I will only be able to show the washing instructions for a single fabric pr. garment (like see attached)

                             The Final set up I ideally was looking for is to visually be able to see all the washing instructions for all fabrics at the same time - Is that not possible at all with this set up..?

                        • 9. Re: Help to set up a 'Master slave'...
                          philmodjunk

                               Apologies.

                               This is exactly what this method is set up to do. That's why you have to click a button in the row of Portal 1 to perform a script to select what data appears in the horizontal portal formed by Portals 2, 3 and 4.

                               It may not be what you wanted, but this is how this method works. It's a commonly used method that works around the limitation that you can't place a portal inside of another portal.

                               I do have another idea, but I'm not sure that it will work, it actually (gasp) uses a repeating field, but I need to gin up a test file to see if my idea can be gotten to work.

                          • 10. Re: Help to set up a 'Master slave'...
                            philmodjunk

                                 Darn,

                                 I had thought that maybe a calculation field with several repetitions could use GetNthRecord ( PortalTable::Field ; Get ( calculationrepetitionnumber ) ) set up as unstored would pull the different portal records into different repetitions of the repeating calculation field. This would then have been something that you could use with a single portal to list the washing care icons horizontally.

                                 But my tests are only showing the first repetition populated with data from the first related record and the remaining repetitions remain empty. frown

                                 I was able to use separate calculation fields for each icon, however:

                                 Let ( N = 1 ;
                                         If ( Count ( RelatedTable::NeverEmptyField )  ≥ N ; GetNthRecord ( RelatedTable::containerField ; N ) )
                                        )

                                 This would be the expression for the first such field. "Container" should be selected as the result type.

                                 For subsequent calculation fields, copy and paste your calculation for the first field, but change the value of N to 2, 3, etc.

                            • 11. Re: Help to set up a 'Master slave'...
                              hanstrager

                                   Annoying..frown But thank you for tryingsmiley

                                   Not sure I understand the calculation field approach.

                                   Will this show all the icons across for all the the fabrics in my portal..?

                                   Do I need to make a calculation field and place the calculation inside there..? or where is this calculation going..?

                              • 12. Re: Help to set up a 'Master slave'...
                                philmodjunk

                                     Your horizontal portal will show up to the number icons as you have one row portals placed on your layout to form the horizontal portal.

                                     If you use the calculation fields, you will be able to show up to the number of calculation fields you choose to define to show this data inside the portal rows of your first portal on the layout where you've been trying this out.

                                     Either way, just like a repeating field, there's a built in upper limit based on what you choose to design into the system when you set this up. That's why I was willing to try a repeating field here when normally I advise against using them.

                                     PS.

                                     Others reading this thread might question why we didn't set up the care entries for these icons in repeating fields from the start, but if you try that, you either have to physically copy the icons into repeating fields that are part of each record--which would make any future updates a nightmare, or you'd run up against relationship problems trying to link different repetitions of repeating fields to different records in your master table of washing instructions and icons.

                                • 13. Re: Help to set up a 'Master slave'...
                                  hanstrager

                                       Do I literally just make a calculation field and put this in as a calculation for icon no. 1 (And the make another for icon 2 and so forth)..?

                                       what field is RelatedTable::NeverEmptyField..? the calculation field where the calculation is inside?

                                       And where do I place the calculation field afterwards. Does it not need to be link to portal 1 somehow..?

                                       sorry I'm just confused about the set up...

                                  • 14. Re: Help to set up a 'Master slave'...
                                    philmodjunk
                                         

                                              Do I literally just make a calculation field and put this in as a calculation for icon no. 1 (And the make another for icon 2 and so forth)..?

                                         If you want to see a row of icons in each portal row of your first portal, Yes.

                                         

                                              what field is RelatedTable::NeverEmptyField..? the calculation field where the calculation is inside?

                                         I was in a hurry when I made that post so I used "place holders" instead of using specific references to your actual fields.

                                         RelatedTable::NeverEmptyField would be any field in the washing Instructions table that is never empty of data.

                                         Substituting actual table::field names you might set it up this way:

                                         Let ( N = 1 ;
                                                 If ( Count ( washing Instructions::Washing Inst_ID )  ≥ N ; GetNthRecord ( washing Instructions::icon ; N ) )
                                                )

                                    1 2 Previous Next