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

Finding a child record on a set's form

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

    #16
    Re: Finding a child record on a set's form

    giving the region focus for purposes of setting an index and doing a find.
    On a form based on a set only the indexes for the parent are available.
    There can be only one.

    Comment


      #17
      Re: Finding a child record on a set's form

      Hence the upside down set.
      See our Hybrid Option here;
      https://hybridapps.example-software.com/


      Apologies to anyone I haven't managed to upset yet.
      You are held in a queue and I will get to you soon.

      Comment


        #18
        Re: Finding a child record on a set's form

        Jeff, here's a method. Requires coding.
        This will start at the first (topmost) record and physically go through until it finds a match.
        First get the count of records. I can only for now think of a calc object like
        Code:
        lines = count(Details->lnkfld,grp->header)
        then

        Code:
        cnt=parentform.lines.value
        if cnt>0 
          parentform:browse1.Fetch_First()
          for i = 1 to cnt
        	if browse1:descr.value=[I]search string[/I]' whatever basis you want the match to be made
                    end ' found match stops on that "record"
                end if
        	if i<cnt
        		parentform:browse1.Fetch_Next() 'don't overshoot
        	end if
          next i
        end if
        others, please feel free to add refinements/comments it's not based on any precedent I've seen but on something I created for updating records on a browse.
        Last edited by Ray in Capetown; 07-27-2012, 05:37 PM.

        Comment


          #19
          Re: Finding a child record on a set's form

          Originally posted by Ray in Capetown View Post
          Jeff, here's a method. Requires coding.
          This will start at the first (topmost) record and physically go through until it finds a match.
          First get the count of records. I can only for now think of a calc object like
          Code:
          lines = count(Details->lnkfld,grp->header)
          then

          Code:
          cnt=parentform.lines.value
          if cnt>0 
            parentform:browse1.Fetch_First()
            for i = 1 to cnt
          	if browse1:descr.value=[I]search string[/I]' whatever basis you want the match to be made
                      end ' found match stops on that "record"
                  end if
          	if i<cnt
          		parentform:browse1.Fetch_Next() 'don't overshoot
          	end if
            next i
          end if
          others, please feel free to add refinements/comments it's not based on any precedent I've seen but on something I created for updating records on a browse.
          This looks like an interesting thing to try. I know it will find the record in the browse, but I wonder if the user experience can be made to look like other finds at the parent level, such as auto complete of what they type in to the dialog.

          Comment


            #20
            Re: Finding a child record on a set's form

            Sure, you prob could do that in a form lookup and there obtain the matching details. For the user experience.
            but then they have to know the first accurate wording of the description.
            I would think to offer the user a partial text input to use to find the record that contains that.
            Quoting Ted "its your sandbox"

            Comment


              #21
              Re: Finding a child record on a set's form

              This thread, while will help those seeking answer to the same question, will better serve as an interesting study & insight on how the human brain & thought processes work!
              You want to "find" the row (record) in the browse that matches a certain product description sought after by the user.
              Well, that's what you "wanted". Very clear & simple.
              So you embarked on attempts and means to "find" that row (record), which lead you down the road of "Finding" a record by a key, an index, or whatever functions alpha has to offer for finding a record..

              No sir, you don't need to find Jack! You need to un-think your thinking process.
              In reality, you don't want to "find or "fetch" but rather you want to "see" where the heck is that record.
              IOW you want this son of a gun to stand out amongst all other records (rows).

              Answer: Highlight the son of a gun with a different color, i.e.
              Use the color coding of the browse rows (enable color equations) to show a certain color when the value in the field "product description" matches what the user enters (in a variable on the form, and instead of auto-complete, better yet, use a drop down list, pop-up window or anything else similar, a list that will have unique values of those product descriptions).
              That's all. Nobody needs to find or fetch anything, that's not to say finding or fetching is not doable. Doable, but wasteful.

              Comment


                #22
                Re: Finding a child record on a set's form

                Insightfult lateral thinking BUT an additional synapse still wants that highlighted row to appear in the browse view or it will be as the tree falling in the forest three pages down out of sight. Still not knowing if it exists.

                Comment


                  #23
                  Re: Finding a child record on a set's form

                  Finding a tree in the forest by looking at every tree until you get to the one you want is one thing... Finding a tree that has dancing clowns and fireworks shooting from it..is something else.
                  That said, right after I wrote the previous post, I turned off the computer and headed to sleep when I realized that my own thinking got wrapped up in the same trap.

                  He wants an easy way to find the record.
                  Why?
                  Because he wants to go there.
                  Why?
                  Because he wants to do something with it or based on it.
                  What?

                  If you answer that last question, then instead of:
                  1-Find the record
                  2-Go there
                  3-Do something

                  you could skip 1 and 2 and just do that something once the user enters the specific value.
                  Let's find out the answer to that before taking a different approach that might not be necessary.

                  Comment


                    #24
                    Re: Finding a child record on a set's form

                    Originally posted by Ray in Capetown View Post
                    Jeff, here's a method. Requires coding.
                    This will start at the first (topmost) record and physically go through until it finds a match.
                    First get the count of records. I can only for now think of a calc object like
                    Code:
                    lines = count(Details->lnkfld,grp->header)
                    then

                    Code:
                    cnt=parentform.lines.value
                    if cnt>0 
                      parentform:browse1.Fetch_First()
                      for i = 1 to cnt
                    	if browse1:descr.value=[I]search string[/I]' whatever basis you want the match to be made
                                end ' found match stops on that "record"
                            end if
                    	if i<cnt
                    		parentform:browse1.Fetch_Next() 'don't overshoot
                    	end if
                      next i
                    end if
                    others, please feel free to add refinements/comments it's not based on any precedent I've seen but on something I created for updating records on a browse.
                    Ray Hendler,

                    I have now had a chance to study your approach and I like it very much. In fact, I modified it to provide an enhanced approach to finding the product desired. The user will be able to provide a phrase or word within the product description and go there. This has considerably more value than just knowing the beginning of the product description.

                    Here is how it stands right now:

                    First they provide, in response to a prompt for text saying "What phrase in the product description do you want to find?" the content to be stored in m_phrase.

                    Then the code is as follows:

                    m_phrase=upper(m_phrase) 'be sure search fragment is upper case
                    cnt=parentform.lines.value
                    if cnt>0
                    parentform:browse1.Fetch_First()
                    for i = 1 to cnt
                    current=upper(msprod->desc) 'be sure field to compare is upper case
                    if trim(var->m_phrase)$current 'test for presence of phrase in product description
                    end ' found match stops on that "record"
                    end if
                    if i<cnt
                    parentform:browse1.Fetch_Next() 'don't overshoot
                    end if
                    next i
                    end if

                    Ray, I appreciate your jump-starting this thought process.

                    Comment


                      #25
                      Re: Finding a child record on a set's form

                      I would suggest that you wrap this in an initial single query to see if the search phrase has a match before you go filing through all the records to try and find a match. And I don't think you have to perform the case conversions that you have in the script. The $ operon is not case sensitive.

                      Code:
                      dim m_phrase as C
                      
                      '>>>> insert text box to collect search phrase
                      
                      if a5_get_records_in_query("msprod",s_quote(m_phrase)+" $ description")>0
                      	m_phrase=upper(m_phrase) 'be sure search fragment is upper case
                      	cnt=parentform.lines.value
                      	if cnt>0
                      	parentform:browse1.Fetch_First()
                      	for i = 1 to cnt
                      	current=upper(msprod->desc) 'be sure field to compare is upper case
                      	if trim(var->m_phrase)$current 'test for presence of phrase in product description
                      	end ' found match stops on that "record"
                      	end if
                      	if i<cnt
                      	parentform:browse1.Fetch_Next() 'don't overshoot
                      	end if
                      	next i
                      	end if
                      else
                      	ui_msg_box("SEARCH ERROR","The search phrase you are using does not find a match.   ",64)
                      end if
                      Mike W
                      __________________________
                      "I rebel in at least small things to express to the world that I have not completely surrendered"

                      Comment


                        #26
                        Re: Finding a child record on a set's form

                        Originally posted by Mike Wilson View Post
                        I would suggest that you wrap this in an initial single query to see if the search phrase has a match before you go filing through all the records to try and find a match. And I don't think you have to perform the case conversions that you have in the script. The $ operon is not case sensitive.

                        Code:
                        dim m_phrase as C
                        
                        '>>>> insert text box to collect search phrase
                        
                        if a5_get_records_in_query("msprod",s_quote(m_phrase)+" $ description")>0
                        	m_phrase=upper(m_phrase) 'be sure search fragment is upper case
                        	cnt=parentform.lines.value
                        	if cnt>0
                        	parentform:browse1.Fetch_First()
                        	for i = 1 to cnt
                        	current=upper(msprod->desc) 'be sure field to compare is upper case
                        	if trim(var->m_phrase)$current 'test for presence of phrase in product description
                        	end ' found match stops on that "record"
                        	end if
                        	if i<cnt
                        	parentform:browse1.Fetch_Next() 'don't overshoot
                        	end if
                        	next i
                        	end if
                        else
                        	ui_msg_box("SEARCH ERROR","The search phrase you are using does not find a match.   ",64)
                        end if
                        Mike,

                        Thanks for this. It makes quite an improvement in those cases where the user doesn't type the phrase properly or the phrase is not present on the list.

                        I was also surprised that the $ function is not case sensitive. I have used this a lot in Visual Foxpro, where it IS case sensitive. Since old habits are hard to break, I'll probably continue to use the trim(upper())) syntax.

                        One question, though. The a5_get_records_in_query function works instantly to determine the presence of the search object. Can't this be used for the actual search instead of the slower cycling through each record to see if there is a match?

                        Thanks.

                        Jeff

                        Comment


                          #27
                          Re: Finding a child record on a set's form

                          Blowing my own idea out the water. I just came across something I forgot I used some time back...
                          This will do it all - ie locate the row in an embedded browse containing text in a column

                          Code:
                          browse1.fetch_first()
                          browse1.locate_next(VAR->m_phrase ,"desc")

                          Comment


                            #28
                            Re: Finding a child record on a set's form

                            Originally posted by Jeff Fried View Post
                            One question, though. The a5_get_records_in_query function works instantly to determine the presence of the search object. Can't this be used for the actual search instead of the slower cycling through each record to see if there is a match?
                            It does the check at table level. You would need to still create a query at table level that I suspect would not work predictably nor be easy to control on the embedded browse. Otherwise Mike and others would have said in the beginning - read those early responses
                            Last edited by Ray in Capetown; 07-30-2012, 06:02 PM. Reason: table level

                            Comment


                              #29
                              Re: Finding a child record on a set's form

                              Originally posted by Ray in Capetown View Post
                              Blowing my own idea out the water. I just came across something I forgot I used some time back...
                              This will do it all - ie locate the row in an embedded browse containing text in a column

                              Code:
                              browse1.fetch_first()
                              browse1.locate_next(VAR->m_phrase ,"desc")
                              Ray, See post #11.

                              All well and good but if the desc column contains "Gary Shandling" and "Handle it gently" in that order, locate_next() supplied "hand" will arrive at the first. That may not be the desired behavior.
                              There can be only one.

                              Comment


                                #30
                                Re: Finding a child record on a set's form

                                delicately put Stan.
                                It was there already, 18 posts and several days back. I missed that.
                                Besides the problem with the "first hit" as you say, I wonder why Jeff didn't try it back then. 'cos thats the nature of the solution he settled with.

                                Comment

                                Working...
                                X