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

    Memo Field Issue

    We have a case tracking system in place where the users can add notes to a memo field. The are very important as no case is assigned to any one worker.

    The memo filed is on our "cb_header" record. This table is VERY heavily used. All data is on the server. Users are using runtime.

    What appears to be happening is that if one worker is saving a record at EXACTLY the same time as another worker is saving a completely different record, the memo data from one overwrites the info in the other. This is becoming more of an issue as the system usage becomes heavier. The data that overwrites the other data is, however, saved properly to its own record. This is why I don't think it is a record locking issue, but more of a variable space problem where one user is grabbing another person's variable space. I don't understand how, but that is what I think is going on.

    The following is a snippet of code where the workers will be entering their information into a variable, then when all the data entry is done, the data is retrieved, and the memo field is copied out to a local variable, the newly created text is wrapped with a header and footer, then the old text is appended to the new text and the whole thing is written back out to the record. The code is controlling the change_begin and change_end of the table, so I really can't see where this should be happening. The code is executed from a button on a form that is opened in "view" mode.

    If anyone can see how this corruption could be happening in the attached code, please let me know.

    Code:
    Dim P as P
    dim aa as P
    delete sumnotes
    delete p_text
    aa = addin.variables()
    varinit()
    workerbyempid()
    vMode = parentform.mode_get()
    debugcheck()
    IF vMode = "CHANGE" .or. vMode = "ENTER"
    	parentform.commit()
    END IF
    tbl = table.get("cb_header")
    clt = table.get("Client")
    
    Dim vCase as C = ""
    vCase = tbl.caseno
    
    dim shared c_name as C
    c_name = upper(trim(clt.fname)+" "+trim(clt.lname))
    'set up prefix for new notes
    re=ui_msg_box(c_name,"Edit "+c_name+"'s Notes?",UI_QUESTION_SYMBOL+UI_SECOND_BUTTON_DEFAULT+UI_YES_NO)
    if re = UI_YES_SELECTED
    	'DO IT
    ELSE
    	ui_msg_box("CANCELLED","AT USER REQUEST")
    	END
    END IF		
    'get the user's worker code and emp_id
    'dim v_emp_ID as N = 0
    'workerbyempid()
    'v_emp_id = accesstoemp(aa.bcbss.access)
    DIM GlOBAL sumnotes as C = ""
    DIM SHARED varC_result as C
    ok_button_label = "&OK"
    cancel_button_label = "&Cancel"
    varC_result = ui_dlg_box( "Case Notes for Case # "+vCase,<<%dlg%
    {region}
    Please Enter Additional Case Notes:;
    {sp=10}[%mw%.120,20sumnotes];
    {endregion};
    {line=1,0};
    {region}
    <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
    {endregion};
    %dlg%)
    if varC_result<>"OK"
    	ui_msg_box(agency,"Action cancelled at user request")
    	end
    end if
    debugcheck()
    'lets do a spell check
    ans_sp = ui_msg_box(agency,"Do you want to Spell Check your Notes?",35)
    if ans_sp = 6 
    	sp = A5_SPELLCHECKSTRING(sumnotes,"text")
    	if sp.lastbutton = "cancel"
    		'do nothing
    	  else
    	  	sumnotes = sp.text
    	end if
      else
      	UI_MSG_BOX(AGENCY,"Spell Check bypassed at user request")
    end if
    
    'clear out p_text
    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.)
    delete sumnotes
    delete p_text
    delete vCase
    parentform.Refresh_Layout()
    Thanks,

    Tom
    Last edited by Tom Henkel; 05-27-2015, 02:33 PM.

    #2
    Re: Memo Field Issue

    After looking at your code I would first suspect the A5_SPELLCHECKSTRING() is mixing up the users notes. If this where the case only the new additions would lost/confused the original content already in the memo field would not be lost. If this proves to be the situation I suspect A5 is using, a not unique enough, temporary file for the spell check function. It would truly be a unique situation where both users are spell checking at same time.

    Comment


      #3
      Re: Memo Field Issue

      That's the problem, though. The new notes are there, but someone else's notes are attached to the new notes. This is why I'm thinking its a variable space issue. But why would variable space be shared among all users, and not unique to the local PC?

      Comment


        #4
        Re: Memo Field Issue

        Not a memo field expert by any means. What seems a possible source of trouble to me is you have

        tbl = table.get("cb_header")
        clt = table.get("Client")

        then the user is presented with the xdialog for note entry (which can take quite a bit of time?) and allow a spell check

        then you get the current value in the memo field (can anything have happened in the meantime to confuse the record pointer like new records?)

        'clear out p_text
        p_text = ""
        'get previous notes and add new notes to them
        p_text=tbl.Notes

        then you save the note with the addendum.

        I would suggest you reissue the

        tbl = table.get("cb_header")
        clt = table.get("Client")

        just before the

        'clear out p_text
        p_text = ""
        'get previous notes and add new notes to them
        p_text=tbl.Notes

        Hard to make major changes to an application as longstanding as yours but I believe the best practice is to have a separate table with only the linking field and the memo field and link that in your set.

        Just noticed the addin.variables(). I don't have much familiarity with that. Is it possible that is sharing the variable namespace?
        Last edited by Stan Mathews; 05-27-2015, 03:29 PM.
        There can be only one.

        Comment


          #5
          Re: Memo Field Issue

          Thanks, Stan, But I ask again, If the form is open as read only, why would the record pointer have changed?

          If the memo record was in a separate, linked table, what would be the difference?

          Comment


            #6
            Re: Memo Field Issue

            As I mentioned, not an expert on the matter. Just remembering

            <broken link>

            Did you see the late addition to my prior post concerning the addin.variables()?
            Last edited by Lenny Forziati; 12-14-2021, 01:08 PM. Reason: broken link removed
            There can be only one.

            Comment


              #7
              Re: Memo Field Issue

              I'll look again at the article, but it just seems strange that the record pointers could be an issue.

              The addin space is separate from the variable space I'm using in this code. It contains those variables I'm passing from database to database.

              Comment


                #8
                Re: Memo Field Issue

                Is the memo field on the form, visible or not?

                You should be able to write the new notes to the form field and commit it, not accessing the table directly.

                I'm thinking

                parentform.restrict_change = .F.
                parentform.memo_object_name = "*** Case Notes - "+ut(tbl.caseno)+" *** "+c_name+" *** "+ date() + ": " +" ("+wcode+" - " +wname +")" +crlf()+alltrim(sumnotes)+crlf()+"************"+crlf()+p_text
                parentform.commit()
                parentform.restrict_change = .T.


                and then the record pointer isn't involved at all?
                There can be only one.

                Comment


                  #9
                  Re: Memo Field Issue

                  Since you guys are way out of my league on this and I had to do all of it the hard way.

                  I chose to NOT do a spell check on entry of rtfmemo fields. Also do not prefer direct entry because the temptation is to big to copy/paste.
                  Preferring instead to do a variable to accept the input and insert at the table level.
                  Copy paste is a separate button because the insert will not accept it(as planned)
                  spell check is done before leaving the record as a separate operation.

                  The copy/Paste button I have has been tested with copied right off facebook to rtfmemo with 0 problems.

                  Code:
                  DIM SHARED vfinumx AS c
                  vfinumx = parentform:File_num.value
                  topparent.commit()
                  'dim recnumber as n = recno()
                  dim shared tablename as c = "pool"
                  dim memoname as c = "comments"
                  dim shared thestuff as c = ""
                  dim shared thenow as t = now()
                  var->thestuff = CLIPBOARD.GET_DATA()
                  dim tbl as P
                  [B]tbl = table.open(var->tablename,FILE_RW_SHARED)[/B]tbl.index_primary_put("file_num")
                  tbl.fetch_find(var->vfinumx)
                  [B]insert_text_in_rtf_memo([/B]tbl, var->memoname, var->thenow + " by " + var->ename + crlf() +var->thestuff + crlf(), 1,"Arial,9","black")
                  I also have the question: Is this using shadowed tables???
                  Last edited by DaveM; 05-27-2015, 07:30 PM.
                  Dave Mason
                  [email protected]
                  Skype is dave.mason46

                  Comment


                    #10
                    Re: Memo Field Issue

                    Dave,
                    if you look at my code, you'll see that that is exactly what I do. I only spell check the newly entered data, and only issue the change on the table after that. I use a dialog for the users to enter data, then I access the table. I don't allow direct entry.

                    No shadows.

                    Tom

                    Comment


                      #11
                      Re: Memo Field Issue

                      Sorry, I did not dissect your code very well.

                      I only work shadowed.
                      Not to say it is the problem, but logic says it could. My logic, that is.

                      With no shadows, everything is done on the server? Or at least, I have no idea what is and what is not done on the server.

                      I know indexing and a lot of other is done on server, regardless of shadowed or not. It was my thought that memory(variables and such) were all done on the work station with shadowed, but how could that be if you work directly on the server?

                      Have you tested with shadowed? Just wondering.

                      edit:

                      Ok, I dissected further and realized this must be running in the form/or which mine is too.

                      Not sure if any of what I say will help, but I have had issues in the past with as little as 35 users and I think you have many more.
                      Going to shadowed helped me, but also a big help was from refraining the use of table_get() and instead using table_open()

                      I am betting more that there is a memory leak in alpha with regard to the variables. We don't delegate a memory space with alph, alpha handles that. But until tested, I can not say for sure and I don't have enough users to test it well. If the variables are residing on the server??? It could be. That needs to be clarified.
                      Last edited by DaveM; 05-27-2015, 07:20 PM.
                      Dave Mason
                      [email protected]
                      Skype is dave.mason46

                      Comment


                        #12
                        Re: Memo Field Issue

                        The other is. I add the information in one step or the other and the spell check is a completely separate deal. That keeps the entry open for a shorter period. At least to me, it made better sense.

                        Another change I did was to move to rtfmemo instead of memo. It may not be a big deal to some, but there seemed to be less problems and better resources for me.

                        I just did a large app with around 65 rtfmemo fields, so had to cover a lot. So far all is well.
                        Dave Mason
                        [email protected]
                        Skype is dave.mason46

                        Comment


                          #13
                          Re: Memo Field Issue

                          Tom:
                          I didn't read the whole code. I stopped at this:
                          Code:
                          IF vMode = "CHANGE" .or. vMode = "ENTER"
                          	parentform.commit()
                          END IF
                          What's the logic here?
                          Also, why are you using addin variables?

                          Comment


                            #14
                            Re: Memo Field Issue

                            G,

                            To be sure that the form that the button is on is not in change or enter mode, I commit it. This way, when I do the "change_Begin", I know that there isn't already a change or entry going on.

                            The addin.variables are "super global" variables that I set in the Main menu of my Calling Database. They are available throughout all "called" databases until A5 closes. My main "calling" database sets these variables for all the other databases (30 or more). These variables are user-id, access level, paths, etc. The system was developed many many years ago before there was alpha security, so we needed to develop our own. When ver 5 came out, we needed a way to retain the variable space between applications, so with a lot of help from Selwyn, we set up this addin variable space.

                            Tom

                            Comment


                              #15
                              Re: Memo Field Issue

                              So, the button is on a form that is based on a table that you want to make changes to. And, to make these changes, you pop an xdlg for the user to enter the new notes, spellcheck the notes, then save to the table. The notes gets eventually saved to the correct record, but you are saying a different user (user 2) on a different machine will see his notes overwritten by the other user (user 1)??
                              And is that a memo? Rich memo?

                              Comment

                              Working...
                              X