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

A5W Page Filter and Order Syntax

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

    #16
    Re: A5W Page Filter and Order Syntax

    I basically followed everything Josh suggested above, with a slight difference on the html map page. His had an onclick event when a state was selected in the dropdown that would match an abbreviation to the state ID. I simply created a URL for each of the 50 states that had the state abbreviation already in it:

    So you click on South Carolina, and this is the link:

    https://snap.scansourcesecurity.com/sales.a5w?state=SC

    I think his javascript was basically doing the same thing based on which drop down you select.


    I have this working great now, and if I click on South Carolina, it takes me to all records where SC is set as the state. My follow up question to that is, what if I have SC, NC, and TX for that record? This method doesn't show records that have multiple entries. Is there a way to tweak this?

    Comment


      #17
      Re: A5W Page Filter and Order Syntax

      That looks good. It's a little bit of work and involves an extra callback... but works nicely.

      Here's a quick video of a UX component using the Raphaeljs library. There's only one onclick event, no callback to set a US State value, and no extra page to call. The List still does a full data refresh once it gets the State value but this could be eliminated as well by just filtering the List client-side. And it even looks good on an iPhone.

      https://youtu.be/rCojg00r_FI

      BTW, the bird you hear in the background is a Mockingbird which was sitting just outside on a branch... what a great voice.

      Comment


        #18
        Re: A5W Page Filter and Order Syntax

        Interesting. Is there any tutorial anywhere that explains that in more detail? And would it support the multi state scenario I described above?

        Comment


          #19
          Re: A5W Page Filter and Order Syntax

          Carl,

          David is leading you towards a much better long-term solution in my opinion. I've become far too dependent on callbacks when you really are supposed to push as much as you can to the client side and avoid callbacks wherever possible.

          I think as David suggested (and there is probably a better way) you can create a comma separated value for the selected states and your filter would now become instead of state = :state, it would now look something like state IN :state where the value of the argument :state would look like CA,TX,HI

          Comment


            #20
            Re: A5W Page Filter and Order Syntax

            Originally posted by carlbsmith View Post
            I guess for state, I could do comma separated values: NC,SC,TX, etc. But when I try to filter by SC for example, it doesn't return a field with multiple options, I guess because it is looking for just SC. Wondering if there is a better way.
            Carl, it's a bit unclear what you'd like to do here. You select a State... SC... and get back a list of Sales Reps for SC. You then Select a Sales Rep and transition to that person's info. In that info, do you also want to see a list of other States that person is a Sales Rep for?

            Comment


              #21
              Re: A5W Page Filter and Order Syntax

              I guess what I am trying to say is that a sales rep might cover multiple states. So John Smith might cover North Carolina and South Caroline. I need his name to come up when I click on either of those states.

              Comment


                #22
                Re: A5W Page Filter and Order Syntax

                Unless you want to write CRUD routines to maintain a comma delimited column per Sales Rep... which is neither advisable... nor fun... then just follow a normal approach to your table...

                RecId RepId State
                1 1 SC
                2 1 NC

                Comment


                  #23
                  Re: A5W Page Filter and Order Syntax

                  Carl,

                  What type of back-end database are you working with? What I usually do in these instances is create a table in my database to map a sales rep to each state he/she needs to be associated with. I would then create a view that returns the appropriate records. Once that is in place everything will work as expected. If you can share what type of database you're working with I can help you see this to fruition.

                  Comment


                    #24
                    Re: A5W Page Filter and Order Syntax

                    Josh, just a standard alpha database on this project. David, not sure I follow your table example above. Thanks.

                    Comment


                      #25
                      Re: A5W Page Filter and Order Syntax

                      David that map is sweet, any chance you want to share that thing? I want the component to build a phone gap app to find some of my users...THAT would save me a bunch of time no doubt - nice job!
                      NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                      Comment


                        #26
                        Re: A5W Page Filter and Order Syntax

                        Thanks for all the feedback thus far. Just wondering if anyone has any ideas on how to implement the idea mentioned above that a sales rep could possibly be assigned to multiple states, not just a single state.

                        Comment


                          #27
                          Re: A5W Page Filter and Order Syntax

                          Any other feedback from anyone? I am so close to getting this to do what I need.

                          Comment


                            #28
                            Re: A5W Page Filter and Order Syntax

                            Carl,

                            The table data that you are basing your list control on needs to have a record of your sales agent for each state they are assigned to. I've never developed an application with a dbf back-end so I am unsure as to the best approach with dbf's.

                            In the SQL world, one way to accomplish this would be to create two tables and a view. I would have a sales_rep table, a sales_rep_state_mapping table, and a sales_rep_state_view

                            So my sales_rep table would look like...

                            rep_ID
                            rep_name
                            rep_email
                            rep_phone

                            I'd create one record for John Smith who is a sales rep assigned to Tennessee and Alabama

                            1|John Smith|[email protected]|(555)555-5555


                            I'd have a second table sales_rep_state_mapping
                            recordID
                            rep_id
                            state

                            I'd create two rows in sales_rep_state_mapping.

                            1|1|AL
                            2|1|TN

                            Now I'd create a join marrying sales_rep and sales_rep_state_mapping, the link being rep_id. I'd make sure to return the rows from the sales_rep_state_mapping table. Once you've created the view, I'd base the list on the data that the view returns.

                            I hope this makes sense. You could create multiple entries in a dbf table to accomplish the same thing but it would be pretty sloppy from a database design perspective. I don't think you can use dbf sets on the web side of Alpha which would be the equivalent of a view in the SQL world. If you can I'd make the change to a mysql or MS SQL express back-end. I'm sure there are many other options as well but DBF seems very limiting to me compared to your other free SQL options.
                            Last edited by coleresources; 02-28-2016, 05:48 PM.

                            Comment


                              #29
                              Re: A5W Page Filter and Order Syntax

                              Josh,

                              I took your advice and have started migrating my database to SQL. It does seem to be more powerful, and creating views like you suggested is helpful.

                              I've created a primary table that has the base sales info (name, phone, email, picture, etc), and joined that to my secondary table where I show the different state/regions that each person is in. I do like this scenario from the aspect that I don't have to load things like a sales reps picture each time. It does seem to be a more efficient way to do it.

                              However, just wondering if there is still even a better way beyond this. Because, for example, if I have a sales rep that covers the east cost, there still has to be 20-30 entries for that one sales rep, one for each state in the secondary table. I think what I would love is if there was a way to set it up like checkboxes, so when I had a new rep, I can just hit a bunch of checks for the states they are in. But the key to that being that I need the check for each state to create a new row in my database. If my state/region field just has a bunch of states separated by commas, that doesn't work for my application unfortunately. I need to have separate rows for each state.

                              Anybody have any additional thoughts on this? Thanks!

                              Comment

                              Working...
                              X