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

List with one to many relation on a UX

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

    List with one to many relation on a UX

    I'm trying to create a list that has a one to many relationship with a field on a form. I'm at a loss. What don't I understand?

    "EstimateID" is the linking field. I created an argument that gets the number from the EstimateID field (see image below)
    2023-01-16.png

    I then use the argument in the filter

    2023-01-16 (1).jpg

    The list doesn't get filtered. The value of CURRENT_ESTIMATE returns the number 0, which I know because I put it in a textbox so I could see the value

    Can anyone direct me so I can get a better understanding of how it's done? ​
    Brad Steinfeldt

    #2
    In your argument definition you have CURRENT_ESTIMATE pointing to the {Estimate} field, but in your description above you say it should be getting it from the {EstimateID} field. These two fields look like they could be different?

    Comment


      #3
      They are the same. I changed the name of the UX field to match now. It was estimate, and now it is estimateID to match the name of the field in the database.
      2023-01-16 (2).png
      Brad Steinfeldt

      Comment


        #4
        I guess the question is, am I doing and thinking correctly? Is that how I'm supposed to get the list filtered by a field on the UX?

        If so, maybe there's something going on in my SQL because I'm constantly getting 0 for my CURRENT_ESTIMATE argument. If I make the argument variable a character, it comes back blank.
        Brad Steinfeldt

        Comment


          #5
          Just makes you wonder if it's as easy to filter a viewbox based on a ux control.
          Gregg
          https://paiza.io is a great site to test and share sql code

          Comment


            #6
            That is easy Gregg but i think the issue here is the argument is not getting the value of a field for some reason

            Comment


              #7
              Make certain the field in the SQL is the same type as the type in the Argument. If you have a numeric argument the fields nee to me numeric, as dos the control type you are baaing the argument on.
              Pete
              Insanity: doing the same thing over and over again and expecting different results.
              Albert Einstein, (attributed)
              US (German-born) physicist (1879 - 1955)

              Comment


                #8
                That's what I get for starting at the end. My guess is the list control is executing the query before the value gets into the control.
                Maybe the trick is to have an on-change event for that control assign the value to the argument, then reload the list control.
                Gregg
                https://paiza.io is a great site to test and share sql code

                Comment


                  #9
                  Thanks all. At least I know I'm doing it the way I'm supposed to. I'll check everything and get back.
                  Brad Steinfeldt

                  Comment


                    #10
                    I checked all the fields and still have the same problem. I think you guys are correct when you say that it's not passing the arguments to the sql statement. I traced the sql and noticed that it runs 3 times. I don't understand the trace data, so maybe it's normal, but these are the three sql commands-- (ellipses added to lessen code)--
                    Code:
                    ----------- Portable SQL to be translated to native syntax ----------
                                   SELECT FIRST 1 … WHERE estimates.EstimateID = :PrimaryKey_1
                                    --------- END Portable SQL to be translated to native syntax --------
                                    ----------- Native SQL with named arguments ----------
                                   SELECT  …  WHERE estimates.EstimateID = :PrimaryKey_1     LIMIT 1
                                    --------- END Native SQL with named arguments --------
                                   ----------- Native SQL passed to driver ---------
                                  SELECT …  WHERE estimates.EstimateID = ?     LIMIT 1
                                   --------- END Native SQL passed to driver --------
                    ​
                    On the third select command in Native, the Where statement is a question mark.

                    I'm done trying to figure it out and will just use a parent list to child list. I have no problems when I do that. I didn't think it would give me such headaches.

                    thanks again.
                    Brad Steinfeldt

                    Comment


                      #11
                      A lot of work to try and help you as we have to guess - so this is my least request show the sql you are emitting. With the select statement in it.
                      Insanity: doing the same thing over and over again and expecting different results.
                      Albert Einstein, (attributed)
                      US (German-born) physicist (1879 - 1955)

                      Comment


                        #12
                        Attached is a proof of concept. You may need to change the Northwinds connection string in each of the lists to see this. But it proves that setting an argument to an item and changing that item can result in a list showing the child items.

                        There is a viewbox on the left of the UX that shows a list of orders from the northwinds database. Select any value in that viewbox list refreshes the viewbox in the centre and the list on the right.

                        The reason for a viewbox in the centre and a list on the right are to show the speed difference between the two, while these are filtered by the argument value this is not very noticable, but if you remove the filter in the VBList and listlist items you will see the difference, the viewbox being noticeably faster. Hopefully this will help someone

                        NorthwindsOrders.a5wcmp

                        Comment


                          #13
                          Pete-
                          I hope I'm not taking too much of your time. If so, please don't feel obligated.

                          This is the sql statement in the list builder:
                          Code:
                          SELECT UnitsInEstimateID, EstimateID, UnitID FROM units_in_estimate  WHERE EstimateID = :CURRENT_ESTIMATE
                          This is the full detail of the query for the list that I got from the trace window (if that's what you need. If not, I'm sorry. I don't know where else to get it. I'm a novice when it comes to sql):
                          Code:
                          ********************* START CA5SQLConnection::ExecuteQuery *********************
                                         Thread running as: DESK2\Steinfeldt
                                          Connection mode for this call is: Portable SQL
                          
                                         ----------- Portable SQL to be translated to native syntax ----------
                                          SELECT  count(*)  FROM units_in_estimate  WHERE EstimateID = :CURRENT_ESTIMATE
                                          --------- END Portable SQL to be translated to native syntax --------
                                          ----------- Native SQL with named arguments ----------
                                          SELECT  count(*)  FROM units_in_estimate  WHERE EstimateID = :CURRENT_ESTIMATE
                                          --------- END Native SQL with named arguments --------
                                          ----------- Native SQL passed to driver ----------
                                         SELECT  count(*)  FROM units_in_estimate  WHERE EstimateID = ?
                                          --------- END Native SQL passed to driver --------
                                          -------- Arguments -------
                                          [1] current_estimate (Input) = 1
                                          --------- Bind Map -------
                          
                                        [1] Argument current_estimate [Input] = 1
                          
                                          ------ Call Result -------
                                          ============================
                                         Call Result:
                                          -----------
                                                        Syntax:                                 MySQL
                                                          API:                                        MySQL
                                                          ResultCode:                       0
                                                          NativeCode:                       0
                                                          NativeText:                  
                                                         Rows Affected: -1
                                                         Rows Returned: -1
                                                          Insert Identity: 
                                                         ----- Formatted Error Message ----
                          
                                                        Success
                                         Current Connection Properties:
                          
                                         Database API = MySQL
                                          Database Syntax = MySQL
                                          Trace SQL = Yes
                                          Trace SQL Format = Text
                                         Trace SQL Level = Diagnostic
                                          Trace SQL File = C:\Users\James\AppData\Local\Temp\AlphaAnywhere\p_21536\a5_temp_4f21d015_23e5_4de8_aaf3_136e9188c708.sqllog
                                          Time zone is UTC (SQLiteOnly) = Yes
                                          SSL = No
                                         Trust Server Certificate = No
                                          Enable Column Encryption = No
                                          UseServerSidePrepare = No
                                          Database Version Requested = 8.0
                                          Database = landscape_estimator
                                          Port = 3306
                                         Server = localhost
                                          UserName = root
                          
                                          ============================
                          
                          
                          Elapsed time in milliseconds: 83
                          *********************  END  CA5SQLConnection::ExecuteQuery  *********************
                          ​

                          Lance,
                          Thanks for sharing the file. I've never used view boxes, so I'm going to test some things on it. I have some queries that take some time. it would be nice to see how it speeds up.

                          -Brad
                          Brad Steinfeldt

                          Comment


                            #14
                            Hi Brad,

                            I avoided list controls and viewboxes for a long time. When I finally gave in, I opted for the viewbox based on conversation
                            from Lance and Pete. They have both been fountains of information and assistance as I work my way through the frustrations
                            of something new.

                            With that said, something I took to heart is loading data up front, then searching the control (in my case the viewbox) for specific data.
                            If you want to see this in action, feel free to check out my video finder app HERE . The only call to my server is at the beginning , when
                            it loads the 1349 records I have into the viewbox. After that, all filtering is done client-side.

                            There are several threads involving me and viewboxes where I work my through as a newbie that has difficulty with text overload.

                            Feel free to reach out for help (I'm far more proficient with mySQL than viewboxes)

                            Gregg
                            Gregg
                            https://paiza.io is a great site to test and share sql code

                            Comment

                            Working...
                            X