Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Working with Filters using Variables on the fly

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Working with Filters using Variables on the fly

    I want to figure this out, but I can't find a How To reference in any documentation for this specific function.

    Is there a document reference that someone can point to where I could learn how to work with Variables in a filter on the fly

    Example;
    When user opens a form, an interactive window will pop up asking what their name is and what region they wanted to view.

    The user will be asked for 4 or 5 pieces of data.
    Name
    Region
    Job Number
    Address

    The user will fill out maybe 2 of those 5 variables and answer
    Name = Joh
    Region = Tor
    Job Number = 123
    Address = *


    Now the form will open and only display records with the following data

    Name = John, Johnny, Johnathan
    Region = Toronto, Northertoram,
    Job Number = ONTO123. MTL1230, PQO9123

    If I want to change any of these crieteria, I would need to bring up a samll interface that will allow changing the contents then the filter would be rerun.


    I have created queries in the Operations menu that satisfy this description and they work great by using the 'Contains' function, but I will never be able to create every instance of combinations that can be used.

    #2
    Re: Working with Filters using Variables on the fly

    Chuck,
    There is more than one way to do as you seem to be wanting....

    First, to help us decide on which to present to you as a possible, tell us the context this will be in...are the filters chosen from a logical on a browse, a form logical or field entry, an xdialog listbox/checkbox, ??

    Once we know the context of where the filters are to be chosen and which method you want to use, then suggestions/solutions should be forthcoming!! :)
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________



    Comment


      #3
      Re: Working with Filters using Variables on the fly

      This would be with one of the 4 being blank. If you want to cover all possibilities, go for it. I have never been able to make a filter expression using "contains" with both the value and the field name being a variable.

      Code:
      dim vName as C="Joh"
      dim vRegion as C = "Tor"
      dim vJob_no as C="123"
      dim vAddr as C =""
      
      if vaddr=""
      	vfilter= s_quote(vname)+" $ name .and. " + s_quote(vregion) + " $ region .and. "+s_quote(vjob) +" $ job"
      else if vjob=""
      	vfilter= s_quote(vname)+" $ name .and. " + s_quote(vregion) + " $ region .and. "+s_quote(vaddr) +" $ address"
      else if vregion=""
      	vfilter= s_quote(vname)+" $ name .and. " + s_quote(vaddr) + " $ address .and. "+s_quote(vjob) +" $ job"
      else if vname=""
      	vfilter= s_quote(addr)+" $ address .and. " + s_quote(vregion) + " $ region .and. "+s_quote(vjob) +" $ job"
      end if
      Mike W
      __________________________
      "I rebel in at least small things to express to the world that I have not completely surrendered"

      Comment


        #4
        Re: Working with Filters using Variables on the fly

        The origin of lookup would be done at the form level. I tried some of the default functions that come with Alpha such as 'query by form', but user has to type in the entire correct value and only the first record appears. I would like to sustain all records in the results so that the user only works with his/her records.

        Thank you for this example, I understand it to a degree, but I'm not sure how to apply it to the interface screen I'm trying to create

        I most likely didn't ask the question correctly.

        I really appreciate the help guys.
        Here is a pictorial of what I'm trying to achieve

        Currently I have a form with a button that opens saved queries. The problem with saved queries is that I'll never be able to capture every combination of instances.

        I would like to click a button and an interface screen pops up asking user to populate 1 or all 4 fields with partial or full data. Then when executing, the results would filter the records to only disply result of the query. Then even when navigating through the records of that form, only those results would be visible.

        Comment


          #5
          Re: Working with Filters using Variables on the fly

          I was thinking, is it possible to set the variables before opening the form. Then the form itself can have a filter on it that will only pull up records that satisfy that variable.

          For instance,
          Just before the user opens the form, an interactive screen could ask them their name, then the only records shown in the form will pertain to that user.

          1 - open the form and a question will ask their name

          What is your name = "Bruce"

          left(PM_Name,len("Variable"))="Bruce"

          The only thing I don't know is how to set the value of the variable before opening the form.

          Comment


            #6
            Re: Working with Filters using Variables on the fly

            Chuck,
            There are so many ways to do what you are wanting and that is probably the reason why you are getting a bit overwhelmed.

            Your last question is one possible and can be done exclusively in Action Scripting (AS). When using AS to open a form/browse there is an option to "Prompt for parameters at runtime"----using the Filter tab in the genie that appears and click on the plus sign will bring up what you need.

            Using variables.....you can set variables from say an additional form or an xdialog that is brought up prior to the form you wish to open filtered....make the variables shared at least. Again, it can be all done using AS.
            Mike
            __________________________________________
            It is only when we forget all our learning that we begin to know.
            It's not what you look at that matters, it's what you see.
            Henry David Thoreau
            __________________________________________



            Comment


              #7
              Re: Working with Filters using Variables on the fly

              Yes, Perfect, I was thinking along the same lines of what you just suggested. As a novice I depend on the Genie, I look for it providing interactive solutions
              Let me work through your suggestions and I will let you know how it turned out..

              You're so right about "Overwhlemed"
              Sometimes I have to step away and try to approach from another perspective. That's where these forum inputs really help.

              Comment


                #8
                Re: Working with Filters using Variables on the fly

                YES ! thanks Mike that concept worked great.

                However now I'd like to ask where that parameter is stored. When the user specified a value during the prompt, was that value stored somewhere. I want to refrence it for another function.

                I also have a �Drop Down Browse� field in the form.
                That field has its own filter expression and shows all records, now I�m trying to set the value of the filter to equal the same value the user inputted when opening the form.

                What can I reference in the 'Drop Down Browse' filter so that it will relate to that same entry specified when the form was opened.

                Comment


                  #9
                  Re: Working with Filters using Variables on the fly

                  Chuck,
                  If you used the prompt at Runtime way to filter your form, the variable is local and cannot be dimmed any other way with AS.....but if you convert it to inline xbasic, you can dimension it as shared which then allows the variable to be used on the form you want.....if it doesn't, then try global but don't think it is necessary to do so given what you have said.
                  Mike
                  __________________________________________
                  It is only when we forget all our learning that we begin to know.
                  It's not what you look at that matters, it's what you see.
                  Henry David Thoreau
                  __________________________________________



                  Comment


                    #10
                    Re: Working with Filters using Variables on the fly

                    I see the error of my ways,
                    I was hoping to filter the Drop Down Browse in the form with the variable defined at the opening however, the drop down browse does not work on the same filter because the filter is defined at a child table level.

                    The way my users navigate through records is to use the Drop Down Browse. I wanted to only show the records that pertain to their names but looks like I can't do it with the opening parameter. The drop down browse shows all records.

                    I'll keep working it, I know Alpha provides a way, there has not been anything I couldnt' accomplish so far.

                    Comment

                    Working...
                    X