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

Delete Records peculiar issues

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

    Delete Records peculiar issues

    Has anyone experienced peculiarities with the Alpha DELETE function?

    For example, I have a button outside an embedded browse that executes the standard Alpha DELETE function. The form is based on a stand-alone table (not a set) and the embedded browse reflects this.

    Trouble is, when I press the delete button, sometimes the record deletes properly. Sometimes the browse deletes the record but only displays one record (even though the table has several more than one record). Today I found that the table had actually duplicated the deleted record and I had two records when I should have had none.

    Is there another command that I need to add here? I have tried refreshing the display and resyncing, without success.

    I realize that this is pretty fundamental stuff I'm asking about, but I would sure appreciate anyone's advice.

    Thanks.
    Tom

    #2
    Re: Delete Records peculiar issues

    Hi Tom,

    Have you tried with a button in the browse to perform the delete?
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

    Comment


      #3
      Re: Delete Records peculiar issues

      Keith,

      No I have never tried it that way. Do you embed the delete command within the browse somehow? I'm not familiar with this at all. Could you explain a bit?

      Thank you.
      Tom

      Comment


        #4
        Re: Delete Records peculiar issues

        Hi Tom,

        Putting buttons onto a browse was a great new feature introduced in V9. There is a video of how to do this somewhere but I cant seem to get onto the page where I thought I had saved it.

        This is one of those tasks to learn how it is done, you do need to see how it several times. Well I did anyway.

        Maybe someone has got a copy of it, I shall have another look in the morning.
        Regards
        Keith Hubert
        Alpha Guild Member
        London.
        KHDB Management Systems
        Skype = keith.hubert


        For your day-to-day Needs, you Need an Alpha Database!

        Comment


          #5
          Re: Delete Records peculiar issues

          Found it, FYI, this was new for V8 not V9 as I mentioned before.

          You can view the video here.

          To delete a record, go to the insertion point and with action script, select Delete record. This will show as Xbasic and you simply click Insert Code and the job is done.

          Let us know how you get on.
          Regards
          Keith Hubert
          Alpha Guild Member
          London.
          KHDB Management Systems
          Skype = keith.hubert


          For your day-to-day Needs, you Need an Alpha Database!

          Comment


            #6
            Re: Delete Records peculiar issues

            Keith,

            Thanks for your help.

            I watched Selwyn's demo of the new v8 features for browses but I didn't see 'delete' addressed specifically. Are you saying that I would put a checkbox column in the browse called DELETE and let the user check it (or not). I presume there would be a button at the bottom of the screen that would then delete all marked records.

            If that is correct, I have two questions. First, how do I set up the field DELETE. Is it a simple variable or a calculated field?

            Second, I'm still giving the browse an 'external' Alpha command to delete the rows that have been marked. How does that differ from having a button that deletes a row at a time such as what I'm presently using?

            Clearly, I'm missing something here. Is it the embedded browse vs the stand-alone browse that makes the difference?

            What do you think?

            Tom

            Comment


              #7
              Re: Delete Records peculiar issues

              Hi Tom,

              Are you saying that I would put a checkbox column in the browse called DELETE and let the user check it (or not)
              No, I'm suggesting that you put a button on the row and make that your Delete action.
              Second, I'm still giving the browse an 'external' Alpha command to delete the rows that have been marked. How does that differ from having a button that deletes a row at a time such as what I'm presently using?
              With a button in the browse, this would only require one mouse click and it would always be the row that has focus.

              Selwyn's video demonstrates how the button works with some simple code to prove that the button worked. Instead of his code you would use your own, but in the same place.

              First you have to create the button then you put in the code for the Event when the button is pressed.
              Regards
              Keith Hubert
              Alpha Guild Member
              London.
              KHDB Management Systems
              Skype = keith.hubert


              For your day-to-day Needs, you Need an Alpha Database!

              Comment


                #8
                Re: Delete Records peculiar issues

                Keith,

                Thank you once again. I think I've got it now. The key is when one puts the delete functionality in a button on a row, it insures that that row (and hence that record) is the one in play. It's not the Alpha DELETE function that matters as much as keeping focus on the record. What's more, I can use any field within the record as my vessel for storing the button and the script...probably the record key would be the best place to start.

                I will further assume that if I convert the Action Script to xBasic, I can then take away the Alpha 5 text in the "Are You Sure" dialog box.

                What do you think?

                Tom
                Last edited by [email protected]; 08-02-2010, 07:56 AM.

                Comment


                  #9
                  Re: Delete Records peculiar issues

                  Keith,

                  The advice you gave worked fine. Thank you.

                  I did notice that I was unable to remove the Alpha Five text from the Delete dialog (Are You Sure?).

                  Do you any suggestions on that?

                  Tom

                  Comment


                    #10
                    Re: Delete Records peculiar issues

                    Tom

                    I'll jump in here right now since it is 4:05 PM in UK, and I am sure Keith would not mind

                    If you are using action scripting to delete a record, action script will usually use something like this

                    Code:
                    topparent:browse1.record_delete()
                    There is no way to turn off the message box asking if you really want to delete this record.

                    If you do not want the confirmation message (which I would suggest that you use, just in case one of your users inadvertently pushes the delete button.

                    If you do not want a confirmation message you would have to use xbasic
                    in the browse events event
                    Code:
                    Dim tbl as p
                    tbl=table.get("yourtablename"  
                           tbl.change_begin(.t.)
                               tbl.delete()
                           tbl.change_end(.t.)
                    This code will immediately delete the current record (the record in the row that the button was pushed) with no confirmation message.

                    But again I would suggest that if you have users working with the browse, that you keep the confirmation message - so at least they get a second chance to not delete.

                    Tom Baker

                    Comment


                      #11
                      Re: Delete Records peculiar issues

                      Tom,

                      Two questions about your script.

                      Shouldn't the line...
                      tbl=table.get("yourtablename"
                      have a right paren after it?

                      And secondly, If the script is saying...
                      tbl.delete()
                      would that not delete the entire table? I'm confused over what actually directs the pgm to fetch a specific record and delete it?

                      Thanks,
                      Tom

                      Comment


                        #12
                        Re: Delete Records peculiar issues

                        Tom

                        First, you are right, there should be a right paren after the "yourtablename". I was typing directly into the post (not a cut and paste sample) and just forgot to finish the line.

                        As far as tbl.delete - here is a link to the help file for .delete()

                        http://support.alphasoftware.com/alp..._.DELETE().htm

                        You would be using the tbl.delete() function on a button on a row in the browse which reports a specific record (current row record). The code would delete the current record (the record being in the row that the button is located)

                        Once again, I would suggest if users are deleting records (or entering records) that you allow for the confirmation of the delete. Sometimes you need a second chance to cancel a delete inadvertently made. Just my way of thinking though.


                        I have attached a zip file showing a embedded browse on a form with buttons to delete the record row.

                        Look at the code for the browses events events to see the actual code for the delete.

                        Tom

                        Comment


                          #13
                          Re: Delete Records peculiar issues

                          Another aspect to be aware of is by using the .t. argument in tbl.change_begin(.t.) you are telling Alpha to honor any field rules you may have set...which may or may not want to be done. The .t. in the tbl.change_end(.t.) simply tells Alpha to commit the change even though the default is .t. when left blank (I also add it explicitly as Tom did to not leave it to chance if Alpha ever got confused!).
                          Mike
                          __________________________________________
                          It is only when we forget all our learning that we begin to know.
                          It's not what you look at that matters, it's what you see.
                          Henry David Thoreau
                          __________________________________________



                          Comment


                            #14
                            Re: Delete Records peculiar issues

                            Thanks Mike. :)

                            Comment


                              #15
                              Re: Delete Records peculiar issues

                              Hi Tom,

                              You responded to a posting of mine on Alpha Forum and I needed a little clarification with something if you wouldn't mind taking a look. I have a form (not a browse) where I need to be able to delete the current record without Alpha's confirming dialog statement appearing. So I added your script first and when that failed, I tried the script straight out of the Alpha operators manual to delete the record.

                              In both cases I got the message that is attached. I tried taking out the change_begin statement and, of course, that didn't work.

                              I'm completely confused.

                              Your help would be greatly appreciated here.

                              Tom

                              Comment

                              Working...
                              X