4 Replies Latest reply on Aug 17, 2011 10:05 AM by willrollo

    view records by field result

      Title

      view records by field result

      Post

      HI

      I am a novice and need some help on a few quite simple questions. I have racked my brain but unsuccessful as yet with a perfect solution.

      I am trying to emulate a similar database to the MYOB accounting (mow Mamut software).

      My "List" layout has a header at the top with buttons reading "Customer", "Supplier", "Employee"' and "All". (See att)

      Underneath, in List view, I have the 25 or so Records with fields such as Name, Telephone and email. (no records imported yet in the attachment)

      I want to be able to click on each of the buttons in the header (customer, supplier etc) to show the related records in the list below. 

      What do I need to do to show this? 

       

       

      In the "new record" layout I have designed, I have a drop down list  (field is called TYPE) that users can choose to determine which category the record should be under (see above, customer, supplier etc). If they select supplier , for example, is there a way to allow a new set of fields to appear that were previously hidden as would not apply to the other categories? Eg, trade discount..

       

       

       

      Is there anyway to be able to double click on a record in my "List" Layout to then open it up in a new window? So it can be viewed/edited...

       

      Hope you can help me as I am at a loss!

       

      The ability to use the drop down menu to select the category of record is important so hopeful yet e answer to my first point will reflect this.

      Thank you for your time...

      Will

      I have attached images of my "new record" layout and also my "list" layout mentioned in point 1.

      Bank-3.jpg

        • 1. Re: view records by field result
          philmodjunk

          I'm guessing that your layout is based on a table called Customers and that "Type" is defined in this field.

          If so, a single script can be performed by all 5 buttons, but with different scritp parameters passed to it to control what the script finds for this layout:

          Set Variable [$Type ; value: Get ( ScriptParameter ) ]
          If [$Type = "All" ]
             Show All Records
          Else
             Enter Find Mode [] //clear the pause check box
             Set Field [Customers::Type ; $Type ]
             Set Error capture [on]
             Perform Find []
          End If
          Sort [No dialog ; Restore ]

          is there a way to allow a new set of fields to appear that were previously hidden as would not apply to the other categories? Eg, trade discount.

          There are several approaches that are possible, but they require a certain level of expertise with FileMaker. Let's hold off on that until you get these other simpler issues resolved.

          Is there anyway to be able to double click on a record in my "List" Layout to then open it up in a new window? So it can be viewed/edited...
          I suggest setting this up with a single click as that's much simpler to implement in FileMaker. If your edit layout lists the same name in Show Records From in Layout setup as you have selected for your list layout, this is very easy to do:

          In layout mode, select the fields that make up a row of your list. Use button setup... in the format menu to turn them into a button. Set the button to do this: Go To layout [specify your edit layout here].


          • 2. Re: view records by field result

            Thank you very much - Actually I worked out a simple but not as comprehensive way of solving my firsti issue by just using a sort script that implements sort order base on a value list, into which I put the type thati wanted sorted at the top of the list. 

            Look forward to hearing how to my second problem! I shall be an expert in no time!

            • 3. Re: view records by field result
              philmodjunk

              You may want to consider this simple approach. Put the "Type Specific" fields on different tabs in your tab control. The user then selects the desired tab to access the fields appropriate to that type.

              Other ways to make layout objects "appear/disappear":

              Use a portal to a related table for your fields (can be a self join to the same table). Include the type field in the portal's filter and use a script trigger on the type field to perform this script: Refresh Window [flush cached Join Results] each time a new value is selected in the type field.

              Create a separate, invisibile tab control where each tab displays these fields for a different value in your type field. Give each tab an ObjectName. (Use the Name box on the Position tab.) Make the object names the same as the values in the field.

              Then a script trigger on the type field can perform this script:

              Go To Object [YourTable::TypeField]

              to select the appropriate tab. With this option, you'll also want to use the OnRecordLoad trigger to perfom the same script so that you see the correct set of fields the first time you access this layout and each time you change records on it.

              Also set the OnObjectModify trigger on this tab control to perform the same script so that the user cannot accidentally change tabs by clicking one.

              Note: I'd set this up first with a visible tab control and test everything to make sure that it works. Then, I'd enter layout mode and change tab fill and border settings to make the tab control invisible.

              • 4. Re: view records by field result
                 Wow. I am off to France for a week but will have a crack at it on my return! I shall let you know how I get on. Thx again