6 Replies Latest reply on Jun 24, 2011 10:37 AM by brian.curran

    Filtering records based on Role type...

    brian.curran

      Title

      Filtering records based on Role type...

      Post

      Hi,
      I have a table that contains customer address details for their sites, client bases, billing offices and head quarters. Each record is assigned a 'role' of either Site, Client, Billing or Group by using a Checkbox set.

      A layout called 'Dashboard' containts a multi tabbed set of forms and I would like to filter the customer address records to view one of the above types at a time.

      Any suggestions on the best way to achieve this? I'm hoping to be able to use something like a checkbox or radio button set or maybe a drop down list if possible.

      Thanks
      Brian. 

        • 1. Re: Filtering records based on Role type...
          TurtleKoala

          It sounds like you want to use a global field. Create a field and in it's options, under the storage tab, set it as global storage. You can then place this field on your Dashboard layout as a drop down list or radio button set. For the value list, use the same value list used for your "Roles" checkbox set.

          You can then create a script that filters the records based on this global field and you can set the script to trigger when you exit the global field.

          Out of curiosity, is it possible for a single address to have multiple roles? If so, this may become a little bit more complicated. If not, I might recommend using a drop down list or radio button set for assigning the role on the customer address record. Checkbox sets are usually used when you want to be able to select multiple options at once.

          • 2. Re: Filtering records based on Role type...
            brian.curran

            Hi Eric,
            I managed the first paragraph fine but I'm not sure how to go about creating the script, maybe something like:

            Show All Records
            Perform Find [globalfield?]

            Yes, it's possible for an address to have multiple roles. For example the Site address might be where the Client works, where we send the Bills and as it's a small company, it might also be the Group address.

            Thanks
            Brian. 

            • 3. Re: Filtering records based on Role type...
              TurtleKoala

              I would probably do something like

              Enter Find Mode[]

              Set Field[Main::role;globalfield]

              Perform Find[]

              The variables that I have in the Set Field set might have different names depending on things like which field your globalfield is located in.

              Also, this will show all records that have the role that you selected even if they also have other roles. I assume you want this, but if not there are ways of dealing with it.

              • 4. Re: Filtering records based on Role type...
                brian.curran

                Hi Eric,
                I can't get this to work unfortunately, I have:

                Enter Find Mode []
                Set Field[Main::role]
                Perform Find []

                The obvious difference here is that ";globalfield" is missing from the Set Field line, when I try entering it in the 'Specify Calculation' box it says that an operatior is required. I've tried using the = sign but that doesn't seem to work...

                Any suggestions?

                Thanks
                Brian. 

                • 5. Re: Filtering records based on Role type...
                  philmodjunk

                  When Setting up Set Field, there are two Specify buttons that must be clicked. To get Set Field [Table::Field ; Expression], add set field to your script and click the first button (specify target field). Select Table::Field from the list of fields. Click OK. Now click the lower specify button (calculated result) and create the expression to the right of the semicolon (;). Do not try to type in the semicolon.

                  • 6. Re: Filtering records based on Role type...
                    brian.curran

                    That did the trick nicely Phil. I set an 'OnScriptModify' script trigger which seems to work fine.

                    Thanks gents, much appreciated...