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

filtering and show all on a filtered form

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

    filtering and show all on a filtered form

    I have a form which is filtered (at startup) to show jobs that are complete.

    ie status = "complete"

    Users can then further filter this form to show only jobs begining with a letter of the alphabet etc. This overrides the startup filter, as does the show all button I have on the form.

    Is there a way of making the startup filter permanent for this for or do I have to add it into the filtering for each button on the form?

    #2
    Lance, more details and examples please.

    When I try to duplicate this I don't lose the original filter, it gets refined by the second filter expression, reducing the number of records in the subset being displayed on form. Probably doing something differently than you.

    Here's what I did:

    1) Use Alphasports
    2) create new form based on Customer table
    3) embed filter to display only records where the first letter of the Lastname field is "B".
    4) drop embedded browse on the form, include columns for lastname and bill_state_region

    when form opens I see only Lastnames that begin with "B".
    If I do a quick filter on "NY" I see only lastnames that begin with "B" and which have "NY" in the bill_state_region field.

    This is working as I would expect.

    -- tom

    Comment


      #3
      Tom,

      My form has the a multi-state button the same as alpha-sports customer form (liked it and the browse so copied and made it work for my form).

      If you filter the customer form in alpha sports at start up to say customer bill_city="Arlington" for example. it filters to the city nicely. then push any of the multi state buttons or all and the others appear. Any way around this? so that the city is still the main filter.

      Another thing I have just discovered while checking this out. I put the filter in form design->form properties save form, go back into it and it works. press the buttons, it doesn't work, go back to form properties in design mode and the filter has disappeared although it was saved is this a bug? or something to do with the multistate button code

      Comment


        #4
        Lance,

        Although your in good hands with Tom, I will offer my 2 cents.

        I have done something similar to what you are trying to do which is retain one filter while adding another.

        In my situation I had a radio button that would filter records by status and then allow me to use the multistate button to further refine my filter by letter.

        Here is the code I used in the multistate button on push:
        Code:
        'Check radio button selection.
        IF var->status = "Complete" .or. var->status = "Opened" THEN 'Radio button not "Both".
        	topparent.restrict_navigation = .T.
        	topparent:tables:results.filter_expression="left(lastname,1)='" + MBltr.text + "'.and. status = var->status"
        	topparent:tables:results.order_expression="lastname"
        	topparent:tables:results.query()
        	
        ELSE
        	'Radio button is "Both".
        	topparent.restrict_navigation = .T.
        	topparent:tables:results.filter_expression="left(lastname,1)='" + MBltr.text + "'"
        	topparent:tables:results.order_expression="lastname"
        	topparent:tables:results.query()
        END IF
        
        parentform:browse1.Refresh_Browse()
        topparent.restrict_navigation = .F.
        var->ltr = "1"
        MBLTR.refresh()
        Hope this helps,

        Scott

        Comment


          #5
          Lance,

          Tell us how you do this:

          If you filter the customer form in alpha sports at start up to say customer bill_city="Arlington" for example. it filters to the city nicely.
          Unless your form is an exact match for the Customer Information form in Alpha Sports it's better if you attach a working copy of your database here so we can replicate the problem and suggest specific soluitons.

          -- tom

          Comment


            #6
            One approach

            Lance,

            Suggest you make a copy of the Customer Information form to play with and then change the OnChange event script for the multi-state button object to this:

            Code:
            'Date Created: 19-Jul-2002 12:21:13 AM
            'Last Updated: 18-Oct-2005 07:11:31 PM
            'Created By  :
            'Updated By  : TEC
            'script for the multistate button on the Customer form in the invoice
            'app
            
            dim tbl as p 
            
            tbl = table.current()
            [COLOR="Blue"]ind = tbl.index_primary_get()    'get pointer to current index/query
            vc_curr_filter = ind.filter_get()    'use pointer to get current filter expression
            trace.writeln(vc_curr_filter)
            [/COLOR]
            [COLOR="Blue"]choice = ui_get_radio("Query Scope",1,"Start from scratch","Additive")
            if choice = "Start from scratch" then
            	' Filter the table, discarding existing query
            	topparent:tables:customer.filter_expression = "left("+searchby.text+", 1) = '" + mulstbtn1.text + "'"
            	topparent:tables:customer.order_expression = searchby.text
            	topparent:tables:customer.query()
            else
            	' Preserve existing query, but filter further
            	topparent:tables:customer.filter_expression = vc_curr_filter +".and. left("+searchby.text+", 1) = '" + mulstbtn1.text + "'"
            	topparent:tables:customer.order_expression = searchby.text
            	topparent:tables:customer.query()
            end if			
            [/COLOR]
            ' Get the current record count
            i = tbl.index_primary_get()
            count = i.records_get()
            
            ' If we found no records, then we put up a warning and show all records
            if count = 0
            	ui_msg_box("Warning", "No records found. Showing all records")
            	tbl.order(searchby.text,searchby.text + " <> \"\"")
            	browse1.refresh()
            	mulstbtn1.text = "1"  '' I chose '1' because it is not in the set A-Z that we display 
            end if
            This script gives the user to narrow the result set by preserving the current filter, and then making the new criteria additive.

            Hope this gives you some ideas.

            -- tom

            ps. my changes are in blue (I hope)
            Last edited by Tom Cone Jr; 10-18-2005, 07:43 PM.

            Comment


              #7
              Tom, when the filter disappeared I was in Alpha sports playing around with the customer form, it does not disappear in my form. My database is getting very large. the set in question has 12 tables all linked therefore may be a bit too big to zip and put here. if your next suggestion (using current filter) does not solve my problem I will try and par it down and send a copy. In meetings today so may not have time to look but thanks for the effort so far.

              Lance

              Comment


                #8
                Lance, a 12 table set used for data entry in a multi-user setting is asking for trouble, in my opinion. Suggest you review this article:

                http://www.learn alpha.com/SimplifyY...ifyYourApp.htm

                -- tom

                Comment


                  #9
                  Tom,

                  Having read the article, it didn't sound a bad idea. especially as my set makes things pretty slow over the network.

                  Spent all weekend re-writing all the code and re-designing all the forms, most of it works!! But got up this morning and suddenly thought about reports that are based on the set. Looks like I will have to keep the set in background for this purpose.

                  I have learned a lot by playing around with the code this weekend thanks for forcing me to do it the hard way.


                  Lance

                  Comment


                    #10
                    Lance, keeping the set definition for use in a report layout is fine. In fact, it's often recommended. It's the use of complex sets to do data entry in a multi-user environment that's often problematic. -- tom

                    Comment


                      #11
                      Tom,

                      Wasn't too bad as I do most of the entering at present, but we do have some people who are not sure about the on/off switch so could be potential problem, once again thank you

                      Comment

                      Working...
                      X