7 Replies Latest reply on Jun 13, 2011 2:08 PM by DavidJondreau

    Merge Variables and if statements idea

    JoshOlivas

      Title

      Merge Variables and if statements idea

      Post

      Hi there, this is my first time posting to the forums because i just cant seem to figure out an answer on my own. I am trying to make a layout that will display sellable inventory from one table to show a text status. As the inventory levels are confidental. for example

      if (Part numbers) qty is = 0 show "unavailble" if > 10 show "limited" if < 10 show "Available"

      The idea is to not reference another field on the layout, but rather have a script that will check for a specified part number and check the sellable inventory and have the if statment change the merge varibles on the layout,(multiple part numbers)

      So is this even close to the correct aproach? Im trying to be very particular with the layout, as it will be on an iPad and im trying to make it seem not like a table of data. But just as a quick elegant reference page for a small amount of items. 

        • 1. Re: Merge Variables and if statements idea
          philmodjunk

          One approach is to add three separate text objects to your layout, positioned on top of each other: Unavailable, Limited, Available.

          Then use conditional formatting on each word to change the font size to 500 when you want that specific word to be invisible.

          • 2. Re: Merge Variables and if statements idea
            DavidJondreau

            You can use a merge variable. Call it $$Status. Add <<$$Status>> to your layout.

            Then use conditional formatting on the merge variable like this:

            Let(

            $$Status = Case ( qty > 10 ; "Available" ; qty > 0 ; "Limited" ; "Unavailable" ) ;

            ""
            )

            • 3. Re: Merge Variables and if statements idea
              JoshOlivas

              Thanks for the replies!

              David, sorry if im struggling to understand, im terribly new to conditional formating, but with conditional formating like the example you gave, how would i specify the part number i want to check for if the part numbers and sellable quantities are in another table? Would i be able to add the part number to the formating and specify what table to and reference for the qty, or would there be a better approach for referencing the part numbers I would like.

              • 4. Re: Merge Variables and if statements idea
                DavidJondreau

                Conditional formatting uses the calculation engine just like many other parts of Filemaker. How would you define this calculation from the record you're on?

                Presumably, you're starting from a record in the Inventory table and you are able to reference the quantities available locally. If not, please clarify what TO the layout is based on and what the other relevant relationships are.

                • 5. Re: Merge Variables and if statements idea
                  JoshOlivas

                  There is only one recond for the layout, soley for the "look" and I am looking for a way of to retrive the part numbers and quantities from another table and just display the "Status"

                  I thought that way i could just have a single page to reference what was or wasnt in stock at a glance, instead of having an individual record for each Part number, only because of the way the elements on the layout are laid out visually.

                  So i have no fields on the layout, only the <<$$Status>> merge Variables. And with no table fields on the layout, im not sure how to tell the Merge Varibles what Part Number to look for and in what table to look in for the QTY.

                  I hope that makes some kind of sense, it did in my head for one minute.

                  • 6. Re: Merge Variables and if statements idea
                    philmodjunk

                    WIth a list or table view layout, Multiple records can be displayed as a single page with each record comprising a single row of data. Thus, you can get your "over view" without having to take the approach you describe here.

                    • 7. Re: Merge Variables and if statements idea
                      DavidJondreau

                      You can do it this way, but the regular list view is easier.

                      If you want, you've got your one record layout. Create a Cartesian (all-to-all) join to the inventory table. Put a portal on the layout showing records from that relationship.