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

Memo Field Issue

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

    #16
    Re: Memo Field Issue

    yep!

    These are just memo fields. The dialog displays a multi-line word-wrap box.

    Code:
    Please Enter Additional Case Notes:;
    {sp=10}[%mw%.120,20sumnotes];

    Comment


      #17
      Re: Memo Field Issue

      What happens to the notes entered by user 2 ? That are supposedly "over-written"? are they lost?

      Comment


        #18
        Re: Memo Field Issue

        Does the cb_header have a unique identifier field? If not then create one and assign each record a unique value. I personally prefer to use api_uuidcreate().

        Now at the very beginning of your script you perform a parentform.commit() inside of a IF ... END IF. Prior to entering the IF ... END IF capture the unique identifier field and save it to a variable. When capturing this value use 'tbl.%Unique_Identifier_fieldname%'.

        Immediately after the IF ... END IF recapture the unique identifier field and compare it to the value your got previously. Throw an error via ui_msg_box() if they are not the same.

        Now at the end of your script you have a <tbl>.change_begin() / <tbl>.change_end(). You want to again capture your unique record identifier and test it against the original saved one before you enter <tbl>.change_begin() as well as after the <tbl>.change_end().

        If at any time your unique identifier does not match what you saved initially you have identified the point in the script where the record pointer jump is happening. You will need to develop the logic to determine which unique identifier is the correct one. Re-fetch the record using the unique identifier and then perform your record write.


        Not having enough information provided to go on I have a suspension that your table index is set to recno() order. Two users start a new record and both are assigned the same recno(). The first user who commits their record keeps the recno() but the next user gets assigned a new one. However the script does not account for the new recno() and saves its memo data the originally assigned recno() which is no longer the correct recno().
        Andrew

        Comment


          #19
          Re: Memo Field Issue

          Originally posted by G Gabriel View Post
          What happens to the notes entered by user 2 ? That are supposedly "over-written"? are they lost?
          Because he appends the old data memo data to the new memo data. He will always have a copy of the over-written data. It will just contain a note that does not belong. Kinda like the "one of these things is not like the others" game. Only much much more annoying.
          Andrew

          Comment


            #20
            Re: Memo Field Issue

            p_text = ""
            'get previous notes and add new notes to them
            p_text=tbl.Notes
            tbl.change_begin()
            tbl.Notes = "*** Case Notes - "+ut(tbl.caseno)+" *** "+c_name+" *** "+ date() + ": " +" ("+wcode+" - " +wname +")" +crlf()+alltrim(sumnotes)+crlf()+"************"+crlf()+p_text
            tbl.change_end(.t.)
            I don't have expert knowledge in xbasic manipulation of tables in desktop scenario, but when I look at this segment it seems to me that if two people are downloading the old copy then add additional notes to it then update the notes part, I would imagine the second one to update will prevail.
            since I do not know how the whole system work, I could be way off on the left field.

            secondly these memo fields are they in separate records or just one long memo field?

            edit: looking back stan had similar concern in post#4.
            is it better to write the code like this

            Code:
            tbl = table.get("cb_header")
            clt = table.get("Client")
            'get  previous notes and add new notes to them
            p_text=tbl.Notes
            tbl.change_begin()
               tbl.Notes = "*** Case Notes - "+ut(tbl.caseno)+" *** "+c_name+" *** "+ date() + ": " +" ("+wcode+" - " +wname +")" +crlf()+alltrim(sumnotes)+crlf()+"************"+crlf()+p_text 
            tbl.change_end(.t.)
            chances are it is fast and that other person will not prevail.
            Last edited by GGandhi; 05-28-2015, 08:04 PM.
            thanks for reading

            gandhi

            version 11 3381 - 4096
            mysql backend
            http://www.alphawebprogramming.blogspot.com
            [email protected]
            Skype:[email protected]
            1 914 924 5171

            Comment


              #21
              Re: Memo Field Issue

              clarification: All memo "notes" are in one file for one table. Even if you have 7 memo fields in a table they all are written to one .fpt file

              The issue is (I think) using the same variable in the same space.

              committing the record before doing anything should solidify the record pointer (no matter what it is) and you have the record pointer to your part of that table and so the fpt file. The jumbling has to be with the variable getting interacted with. I am assuming the record has been committed, which may be wrong??

              Well, so much for logic.
              Dave Mason
              [email protected]
              Skype is dave.mason46

              Comment


                #22
                Re: Memo Field Issue

                clarification: All memo "notes" are in one file for one table. Even if you have 7 memo fields in a table they all are written to one .fpt file
                thanks dave. I never used memo fields, never knew. thanks
                thanks for reading

                gandhi

                version 11 3381 - 4096
                mysql backend
                http://www.alphawebprogramming.blogspot.com
                [email protected]
                Skype:[email protected]
                1 914 924 5171

                Comment


                  #23
                  Re: Memo Field Issue

                  Dave hit the nail on the head. This is not a memo field issue but rather a variable issue along with few other issues..just didn't want to respond prematurely till I hear the answer to that question: What happens to the notes written by the second user?
                  Tom says, the second user finds out that his notes are "over-written":
                  1-When does he find that out? At what point?
                  2-Tom says, the notes from the first user are eventually saved to the right record. OK. What about the notes from the second user? Are they lost?
                  3-And where are the addin variables used? I don't see them in this code spinet. and why are they necessary?
                  4-Further, the code has couple of user-defined functions. What do they do?

                  Comment


                    #24
                    Re: Memo Field Issue

                    The issue is (I think) using the same variable in the same space.
                    Trying to understand what you're saying.

                    Each machine running the database, runtime or developer, has its own system memory and thus its own variable namespace. There shouldn't be any possibility of crossover of variables and their values from one machine to the other. Since variables only exist in memory, how would one machine know what was in another's memory?

                    How would you use different variables on different machines?
                    There can be only one.

                    Comment


                      #25
                      Re: Memo Field Issue

                      Originally posted by Stan Mathews View Post
                      Trying to understand what you're saying.

                      Each machine running the database, runtime or developer, has its own system memory and thus its own variable namespace. There shouldn't be any possibility of crossover of variables and their values from one machine to the other. Since variables only exist in memory, how would one machine know what was in another's memory?

                      How would you use different variables on different machines?
                      All excellent observations and questions....however;
                      There is no cross-over of variables. It's all a slight of hand and timing issue.
                      Part of the problem is the variable and another is table.get() not to mention few others..
                      Still waiting on Tom's response..
                      My original gut response to Tom was and still is, along with other suggestions, is to make sumnotes user-specific.

                      Comment


                        #26
                        Re: Memo Field Issue

                        is to make sumnotes user-specific
                        agreed and almost inserted it earlier, but don't understand why I did not. That issue would(I think) disappear with shadowing where the variable is not in any kind of shared memory environment.
                        Dave Mason
                        [email protected]
                        Skype is dave.mason46

                        Comment


                          #27
                          Re: Memo Field Issue

                          What happens to the notes entered by user 2 ? That are supposedly "over-written"? are they lost?
                          Users typically notify me hours/days/weeks later when they or someone else next looks up the notes. It would certainly be nice if we could see it immediately after it happens.

                          Yes, the original notes from user 2 are lost. It's good we have backups.
                          here's the scenario. User1 and user2 both want to enter notes for different cases. When they are finished entering, for each user, the code retrieves the notes from the table to a variable. The code wraps a header and footer around the new notes, then it append the old notes that are captured in the variable to the new notes (so the newest are 1st in the field), then save the whole thing to the notes field in the record. I am trying to minimize the time I actually have the table open to avoid any kind of table locking issues. User1 saves their notes just fine, but user 2 appears to have user1's saved notes appended to their new notes.

                          All records in the cb_header have unique identifiers; ie; case number and ssn. There are not any duplicates. The form is indexed on case number or ssn depending on how it got opened.

                          The sample I gave is just one of numerous points where users can enter notes for this case. All entry into case notes occur through dialog input similar to the sample. I do not allow any direct entry from any form. Like I said earlier, notes are critical as there is not ONE caseworker working on any given case.

                          The table.get() is used to capture the record that is in focus on the form when the user presses the button to edit/create notes.

                          I will look further into the "unique identifier" that Andrew brought up.

                          Thanks,

                          Tom

                          Comment


                            #28
                            Re: Memo Field Issue

                            Originally posted by Tom Henkel View Post

                            All records in the cb_header have unique identifiers; ie; case number and ssn. There are not any duplicates. The form is indexed on case number or ssn depending on how it got opened.


                            I will look further into the "unique identifier" that Andrew brought up.
                            No need to investigate the api_uuidcreate() you already have a unique record identifier Case Number + SSN. I am assuming the concatenation of these two fields makes the record unique. Capture these two fields and test their values during the course of your script.

                            Originally posted by Tom Henkel View Post
                            Yes, the original notes from user 2 are lost.
                            Originally posted by Tom Henkel View Post
                            User1 saves their notes just fine, but user 2 appears to have user1's saved notes appended to their new notes.
                            Not sure you have tracked this all way down to the different possibilities of results. The above two statements are mutually exclusive.

                            Originally posted by Tom Henkel View Post
                            The sample I gave is just one of numerous points where users can enter notes for this case.
                            It is very possible that based on the fact you have multiple methods of adding notes to memo fields that you are encountering multiple issues and each issue results in a different outcome. Each issue would need to be solved individually. Maybe it would be beneficial for you to upload a copy of your database.
                            Andrew

                            Comment


                              #29
                              Re: Memo Field Issue

                              regarding the multiple instances. I use the same code to create and save the notes in all instances.

                              Comment


                                #30
                                Re: Memo Field Issue

                                Originally posted by Tom Henkel View Post
                                regarding the multiple instances. I use the same code to create and save the notes in all instances.
                                That simplifies things quite a bit. Proceed with capturing the unique record identifier and testing it during the script. When the values are not the same record the original values, the new values, date and time. You will use this log to help track down the issue. Develop a method to return the record pointer to the correct record when the values are different.
                                Andrew

                                Comment

                                Working...
                                X