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

How to delete?

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

    How to delete?

    V10 2814-2539

    I have a set based on a Customer table linked to a Repair_invoice table by customer_id with a one to many link. The Repair_invoice table is linked to a Repair_item table by invoice_number with a one to many link set with referential integerity to cascade changes and deletes.
    On my form based on this set I have a button to delete an invoice that I have selected.
    When I delete Invoice number say TEST1 it is deleted as expected. But when I open a default browse of the repair_item table, TEST1 is still there. TEST1 is gone in the default browse of the Repair_Invoice table.
    I guess my question is: I thought referential integerity was supposed to delete child records when the record was deleted in the parent, and if not what is the best way to set up a button to delete all the repair_items linked to the deleted invoice_number besides manually opening the default browse and deleting them?

    #2
    Re: How to delete?

    Garry

    I created a sample app based on your specifications (I think).

    I have a parent with a child (recent_work) 1:M no referential integrity, Recent_work then has a child(repairs) 1:M with referential integrity (cascading deletes).

    There is a button on the form to delete the highlighted record in the recent_work browse (browse1). When you push the button the invoice is deleted from Recent_work and it relations with the child (repairs) the invoice number is also deleted.

    The set in this case is called Testing 1. Look at how the set is set up - see if it is like your set. (set up the same way or what did I do differently)

    By the way you are working with an older release (nothing wrong with that if everything is working okay - I tried the app with the release you are working with and it still worked okay.

    Tom

    Comment


      #3
      Re: How to delete?

      Thanks Tbaker, what you sent me is exactly what I have. Only difference, yours does what it's suppose to and mine don't. When I deleted an invoice on your form and then went to the default browse of the repair table they were deleted like I thought they should be using cascade changes and deletes.
      My set is configured exactly the same as yours and my delete button has the same action script but my repair items are not being deleted in the repair item table. I did however notice and this is strange, if I open the set up in the default browse the repair items are deleted there.

      Comment


        #4
        Re: How to delete?

        Garry

        Can you post a sample so we can get a look to see what is causing this.

        Tom

        edit:
        As far as opening the default browse for the set, if the invoice numbers were deleted in the Repair_invoice table and still existed in the repair_items table, they would not show up on the default browse for the set since there would be no link to the repair items table. But they could still be in the repair items table.
        Last edited by Tbaker; 09-06-2010, 08:02 PM. Reason: Added additional information

        Comment


          #5
          Re: How to delete?

          Please clarify. Are you saying the child is being deleted but the grandchild is not, or are there two child tables? A sample of your database would help us understand what you have.

          Comment


            #6
            Re: How to delete?

            Here is my db, be merciful this is my one and only attempt at a database I use at work to track sales and repairs at a small mom and pop furniture store where I do the tv and appliance repair.

            First, if you want, you can click the Enter Repair button on the menu then find some customer ,just remember their name, and enter a repair invoice you can remember. Then from the menu go to View Sales and Repairs and lookup that customer. The repairs are at the bottom. Delete the repair, then goto the repair_item table and the invoice is still there.

            Comment


              #7
              Re: How to delete?

              Garry

              Edit - Garry read the edit at the bottom of this post

              I have gone over your set and the form and your set is set up correctly.

              I have come to the conclusion it is the build your are using - 2814-2539 that is causing the problem.

              I tried your app in that build on my machine and it does the same thing - pushing the button deletes the repair invoice number but does not delete the repair items associated with that invoice number.

              I have tried it with build 3040-3571 and build 3272-3589 and it works every time - the only thing is there is a refresh problem with the repair-items browse after the delete, the records still show in the repair items browse until you shift to another record and then come back - at that time the browse refreshes and the records are no longer there.

              I would suggest that you update your version to a newer build perhaps 3040-3571 or the 3272-2589 the next to last update (update of Sept 03 2010.

              I will try using xbasic to delete the invoice in the repair invoice browse which will allow the refreshing of browse4 and browse3. Hopefully, it can be accomplished.

              I could not see anything wrong with the set with the exception when using a version of 10.5, with the new xbasic set editor, there was a box checked in the repair-items set properties to be case sensitive - I unchecked that box. Why it was there I don't know, since when in 2814-2539 (which uses the old set editor) there were no boxes to check for case senstive.

              Tom Baker

              Edit

              I did a little more investigating. I went back to the build you are using 2814-2539 and changed the code behind the delete repair button in the repair invoice to xbasic and then put in the following code

              Code:
              dim res as n
              dim tbl as p
              
              res=msgbox("Caution","Do You really want to delete this record?",UI_QUESTION_SYMBOL+UI_YES_NO)
              	if res=ui_no_selected then
              	    cancel()
              	    end 
              	end if
              
              
              tbl=table.get("repair invoice")
              	tbl.change_begin()
              	tbl.delete()
              	tbl.change_end(.t.)
              	
              parentform:cond1.refresh()
              parentform:browse3.activate()
              parentform:browse3.refresh()
              parentform.Refresh_Layout()
              I then opened the View Sales and Repairs form, and deleted an invoice using the new code behind the Delete Repair button, and it deleted the record in the repair invoice browse as well as in the repair items.

              I have revised the zip file you sent me with the above code. Don't update yet, try this one using you current build 2814-2539.

              Tom
              Last edited by Tbaker; 09-06-2010, 10:26 PM. Reason: Added a zip file

              Comment


                #8
                Re: How to delete?

                Here is the latest on this - Garry was using build 2814-2539 of V10. In reading the release notes for the next update after that build - one of the bugs that was fixed was Set Referentail Integrity and cascading deletes that were not working properly.

                The code that I provided in the button on the repair_invoice form, did work sometime but not all the time - it was hit or miss (however, it did solve the refresh problem that I saw when deleting the records in the browse).

                The outcome was to update to a later patch (update) to overcome the cacading deletes problem.

                Just wanted to post this for future reference to future readers of this post.

                Tom Baker

                Comment

                Working...
                X