9 Replies Latest reply on Jul 11, 2012 9:58 PM by tracylynn1212

    Certain Image to show in layout depending on selection from drop down list

    tracylynn1212

      Title

      Certain Image to show in layout depending on selection from drop down list

      Post

      FMP Pro 12 Advanced for Mac.

      Hello,

      I am curious to know if this scenerio can be done. I have a layout that contains a product drop down field. The drop down lists the various products we have to sell. To the right of the field, I have a spot on the layout (currently a container field) where I would like an image of the product to appear depending on the selection made in the Products Type field. For example, if Product A is selected, then an image of Product A appears in the container field. If Product B is selected, then an image of Product B will appear, so on and so forth.

      Is this possible?

       

      Thank you!

        • 1. Re: Certain Image to show in layout depending on selection from drop down list
          philmodjunk

          It's quite possible.

          Most invoicing systems are built around these relationships:

          Customers---<Invoices----<LineItems>-----Products

          And your drop down list would be located inside a portal to LineItems on the Invoices layout.

          If this is what you have, you can define a container field in products for the product picture. Then add this field from Products to the portal row and when you select a product in the drop down, the matching product ID will automatically appear.

          • 2. Re: Certain Image to show in layout depending on selection from drop down list
            tracylynn1212

            Actually, I may have not said this right. When I said "if Product A is selected, then an image of Product A appears in the container field. If Product B is selected, then an image of Product B will appear, so on and so forth"..I didn't mean that I wanted the ability to have several products and their corresponding images under one entry.

            Each entry/record will only have one product total. The user would select a product from the field's drop down list and once selected, only one picture (the drop down selection's matching picture) would show up on the layout. So, for example, if the user selects Product A from the drop down list, Product A picture shows up. If the user changes that field from Product A to Product B, then the image changes to Product B.

            Does that make sense?

             

            Thanks for the oh so quick response!!!!

            Note from PhilModJunk:

            For some reason, comments are closed, so I can't use Post A Answer to reply to your last post. As Community Leader, I can edit the posts of others so I am taking advantage of that ability to reply at the bottom of this post. The method for displaying the product Image is the same whether you have one product or many selected.

            • 3. Re: Certain Image to show in layout depending on selection from drop down list
              tracylynn1212

              Thank you Phil. I just realized your last comment in my comment. :o)

              I understand what you are saying, but think I need an explanation of how to go about making it work. Currently I have the all the different types of Products in a value list, not a table. Are you suggesting I should have a separate table for my Products, that way each product type can have it's own ID? Below is my current relationship:

              • 5. Re: Certain Image to show in layout depending on selection from drop down list
                tracylynn1212

                Hi Phil,

                After rereading your post and messing around with it some more, I was able to get it to work by doing the following:

                1. In addition to my existing Inventory table, I created a Product table to enter all my product types. It contains the fields: Product ID (serial number field), an Inventory ID (number field that will relate to the existing Inventory table), Product Type (drop-down text field sourced to a custom value list) and Product Image (container field that is not Global).

                2. I entered a few new records in the Products table such as Product A as the first record, Product B as the 2nd record, Product C as the 3rd record, and so forth. Additionally in each record, I drag and dropped a picture of each product into the Product Image container field. Each record/product now has it's own corresponding image on the Products layout.

                3. I created new relationships:

                Products::Inventory ID >---X---< Inventory::Inventory ID

                Products::Product Type >--- = ---< Inventory::Product Type

                4. The image field on the Inventory layout where I want the Products picture to show is a container field that is sourced to Products::Product Image.

                5. I created another Value List that sources the values of the list from the field Products::Product Type and applied that new value list to my Inventory::Product Type field on my Inventory layout.

                Now when in my Inventory layout, and I select Product B from my Inventory::Product Type field, a picture of Product B shows up in the Products::Product Image field on my Inventory layout.

                There were some issues I came across along the way, such as realizing not to set the image container as Global, as that will apply the one picture across all Products records. After a bunch of mess-ups, this seems to work so far.

                 

                I thought to post my steps in the event someone out there might want to know, or may have other ideas on how to accomplish this, or maybe to tell me there could have been a simpler way.

                 

                Thank you!

                 

                • 6. Re: Certain Image to show in layout depending on selection from drop down list
                  Abhaya

                  Hi

                  Please go through this and i thinks its so simple.

                  You are in Inventory table and Product type is selected by the Inventory table's filed.

                  So Just make 2 relationship

                  1>Inventory::InventoryID=Product::InventoryId

                  2>Inventory::ProductType=Product::ProductType

                   

                  If user select a product type in INventory layout then it relates the value with product table and brings the Images from their.

                  Just keep the related product Image field in the Inventory Layout.

                   

                  Hope you will get the best solution from my understanding.

                   

                  Thanks

                  • 7. Re: Certain Image to show in layout depending on selection from drop down list
                    tracylynn1212

                    Yes, thank you Atauf. From what you are saying, that's exactly what I did. The only thing different that I have is the relationships. They are as you stated, except I have #1 (Inventory ID) set up with "X" relationship, not "=" for when I originally tried it as "=" the image field on my Inventory layout would not show an image. Once I changed it to "X" it would appear.

                     A lot of what I do in this program is just mess around with it until I see it working. Sometimes the logic behind why it does work gets confusing. :o)

                    • 8. Re: Certain Image to show in layout depending on selection from drop down list
                      Abhaya

                      Hi

                      Is the Image field in Inventory layout [Invettory::P.Type=Product:P.Type] relationship?

                      I have tased it in my end as follows.

                      Inventory and Product table.

                      In Inventory i have created 2 fileds e.g g_prodID and Item

                      Not necessary the InventoryId will maintain in Product table.

                      So i have cretaed 3 products in proct table.

                      In Inventory layout.

                      I kept 2 fileds like  Item above on g_prodID.

                      Item has browse mode of and a value list with all products are attached with the g_ProdID field which keeps the ID but shows only the ProductName in Browse mode.

                      When a product is selected from the value list let sey ProdB(its ID is 2) then the g_ProdId holds the 2.

                      I have done a relationship based on the g_ProdId and Kp_ProdID and from this relationship i am fetching the Item field.

                      I am putting the  ProductImg field directly from the above relationship which shows the exact answer.

                      Means each time the valuelist replacing its related productImg.

                       

                      If you want this value then go through it.

                       

                      The main problem in your end e.g InventoryID is not maintaing in Product(not sure)

                       

                      Thanks

                      • 9. Re: Certain Image to show in layout depending on selection from drop down list
                        tracylynn1212

                        Thank you for your post. I did get it to work based off these relationships.

                        Products::Inventory ID >---X---< Inventory::Inventory ID

                        Products::Product Type >--- = ---< Inventory::Product Type

                        I am able to auto populate the correct image on the Inventory layout based upon what I select in the Product drop down field on the Inventory layout. But in order for it to work, it had to be an "X" relationship between the two Inventory ID's on each table. If I had it at "=" relationship, the image would not appear at all. I am not sure why that is so, but I got it working so that's good enough for me!

                         

                        Thank you!