Alpha Video Training
Results 1 to 13 of 13

Thread: Trouble finding a way to mark grandchild records

  1. #1
    Member
    Real Name
    Ray Camacho
    Join Date
    Sep 2007
    Posts
    62

    Default Trouble finding a way to mark grandchild records

    I’m having trouble finding a way to mark grandchild records.

    I have a set with the following structure:

    The Parent table has a 1-to-many relationship with the CHILD table (Called Childtable1). Childtable1 is also linked to its own child table in a 1-to-1 relationship. That table is called Childtable2.

    I’ve built a form that shows fields from the Parent table. I’ve added an embedded browse to show the fields from Childtable1. I’ve added a second embedded browse to show the Childtable2 records.

    If I run a search and use Records > Delete/Mark/Unmark Selected Records…, the Parent records, Childtable1 records, and Childtable2 records all appear marked when viewed by my form. However, when I go look in Childtable1 and Childtable2, Childtable1 records are marked, but Childtable2 records are NOT marked.

    Is there a way to mark the Childtable2 records?

  2. #2
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Trouble finding a way to mark grandchild records

    HI Ray,
    Your thread got a bit buried. If you still need help with this let me know....when a set is used a mark operation seems to just look or see the parent table. If just the child table is used in the operation it works as expected. Converting to xbasic is fairly straightforward to modify what you want as well. Not knowing the context (IOW having a sample) it would be hard for me to guess at the exact method to use to achieve your goals.

    basically in xbasic--
    Code:
    dim a_tbl as p
    a_tbl = table.open("childTable2 table")
    
    a_tbl.mark_range("ChildTable2_Filter")
    
    a_tbl.close()
    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
    __________________________________________




  3. #3
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: Trouble finding a way to mark grandchild records

    I’ve added a second embedded browse to show the Childtable2 records.
    ??
    Isn't childtable2 linked to childtable1 on 1-1?
    And if so, why a browse?
    the Parent records, Childtable1 records, and Childtable2 records all appear marked when viewed by my form
    How do you know that? The mark you see on the form relates to the topparent.
    Is there a way to mark the Childtable2 records?
    Yes, but first:
    It seems that you want to mark all tables not just childtable2. Very reasonable expectation on your part. You want when deleting these records to have them marked (or just simply mark them), but childtable2 does not get marked. The reason alpha did not mark childtable2 is because in a 1-to-1 it is viewed as part of it's parent table (childtable1), which I consider a bug in this scenario.
    But before we make it a full fledged bug, which I am sure it is, zip a sample of your db if you can.

  4. #4
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,212

    Default Re: Trouble finding a way to mark grandchild records

    is there a reason it wouldn't just be:

    dim t as p
    t = table.get("childtable2")
    t.mark()

    put it on a form button or browse on double click event?
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  5. #5
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Trouble finding a way to mark grandchild records

    Mike,
    Using table.get() may work as well. But from Ray's post it also seemed to imply that more than one record was being marked as a result of a query---if I guessed correctly, then .mark_range() would have to be used that can use a filter or a loop created. Just how I took it to be...doesn't make it necessarily so!! :)
    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
    __________________________________________




  6. #6
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,212

    Default Re: Trouble finding a way to mark grandchild records

    Mike,
    I’ve built a form that shows fields from the Parent table. I’ve added an embedded browse to show the fields from Childtable1. I’ve added a second embedded browse to show the Childtable2 records.
    The Parent table has a 1-to-many relationship with the CHILD table (Called Childtable1). Childtable1 is also linked to its own child table in a 1-to-1 relationship. That table is called Childtable2.
    Given this, I do not believe there will ever be more than a single grandchild record showing since it is 1:1 with Child table..... right? I believe that was Gabriel's point.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  7. #7
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Trouble finding a way to mark grandchild records

    Given this, I do not believe there will ever be more than a single grandchild record showing since it is 1:1 with Child table..... right? I believe that was Gabriel's point.
    I agree....all a matter of perspective though and most likely you are correct.

    I took the scenario to be that a query was run for the parent records and that the grandchildren of these parents would then be marked that met a filter of some kind....which means that more than one grandchild record could be marked regardless of what was showing. Incredible how things can be so totally different from a small perspective change.

    -----Ray would have to tell us to be sure.
    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
    __________________________________________




  8. #8
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: Trouble finding a way to mark grandchild records

    I think Ray's form design is a little unusual in that he placed a browse for the grandchild when all he could get is only one record from that table since the link is 1-to-1. He might have a reason for that, but the design is not critical to his question.

    He marks the "record", whether he marks "it" as he deletes it or just marks it, again that's irrelevant.

    What is relevant is the fact when he marks the "record", the parent gets marked, the child gets marked, but the grandchild does not get marked. Obviously that could create a serious problem.

    I haven't tested this, but I believe it to be the case as alpha treats the grandchild here as part of the child and only marks the child and thus I see this as a bug.
    Last edited by G Gabriel; 10-28-2008 at 01:09 PM.

  9. #9
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Trouble finding a way to mark grandchild records

    I thought about this today as well and when I finally woke up I realized what G and Mike were attempting to say! :D :o

    So it would be nice to have Alpha automatically mark the grandchild, especially if the "mark" is being used for a delete operation --otherwise an orphaned record--unless referential integrity was in force.

    So when marking a child record that has a one-to-one linkage, one also, apparently, has to independently mark the associated grandchild record.

    Could this be used in some way I wonder, in that if it did this automatically, would this then prevent a possible use of this scenario?? IOW, could there be a reason to mark the child and have the possibility of not having the grandchild marked? Such as maybe a query that brings up filtered child records, marks them, and then another query/filter that would further limit the records by limiting the grandchildren due to the filter......???? Just supposing......
    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
    __________________________________________




  10. #10
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,212

    Default Re: Trouble finding a way to mark grandchild records

    I agree with Gabiel. This is a bug!
    This scenerio, I believe, would fall under what Dr. Wayne writes about when he says to move notes (memo field) to their own table and link them 1:1 to associated table.

    I am going to post this as a separate thread to get more viewers to test this and get more opinions as to bug or not.
    http://msgboard.alphasoftware.com/al...ad.php?t=76246
    Last edited by Mike Wilson; 10-30-2008 at 11:47 AM.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  11. #11
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: Trouble finding a way to mark grandchild records

    Mike:
    I am reluctant to call it a bug as of yet since if you have integrity turned on, the grandchild will be marked. I prefer to see what Ray's set looks like, but what puzzles me, if he has the integrity turned off, how does the child get marked? Not a difficult question to answer: if he has the integrity turned on for the child and off for the grandchild which is not unlikely scenario.

  12. #12
    Member
    Real Name
    Ray Camacho
    Join Date
    Sep 2007
    Posts
    62

    Default Re: Trouble finding a way to mark grandchild records

    Thanks everyone for responding. I did not know that Referential Integrity was required for the grandchild record to retain the mark. After I changed that, the grandchild record retained the mark.

    I’m a newbie to database design. I bought Alpha 5 for my non-profit agency after Filemaker Pro could no longer meet our demands. The only Alpha 5 resources I have are:

    Alpha 5 User Guide ver 9
    Alpha 5 Made Easy ver 9
    XBasic for Everyone

    I just re-checked these resources, and didn’t find anything explaining that Referential Integrity was required for the linked table to retain the mark.

    Is there an additional resource that anyone could suggest?

    Thanks in advance.

  13. #13
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Trouble finding a way to mark grandchild records

    Hi Ray,
    The only two references I basically have ever used--

    The help files http://support.alphasoftware.com/alphafivehelpv9/

    and this messageboard.

    Between the two of these and learning how to search them (which can take a while in itself to learn!) I have found almost everything I needed to know...and when I couldn't I availed myself on this board and asked the generous people here.

    I really should read through those materials you referenced sometime--especially Dr. Wayne's book which I have only "skimmed" so far.

    Some things such as knowing the answer to this question, requires an understanding of a relational database and how Alpha works---the latter is something I still learn about quite often (I have a ways to go yet I might add!), but it does come easier over time I have noticed as well....
    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
    __________________________________________




Similar Threads

  1. ew grandchild records for parent
    By richard2007 in forum Alpha Five Version 8
    Replies: 8
    Last Post: 02-08-2008, 08:46 AM
  2. Grandchild records not displaying...Help please
    By P Sabourn in forum Alpha Five Version 6
    Replies: 13
    Last Post: 11-29-2004, 02:04 AM
  3. Can't Mark Records
    By J. Doonan in forum Alpha Five Version 5
    Replies: 7
    Last Post: 02-21-2003, 06:11 AM
  4. Filtering grandchild records problem
    By Anthony Cappelletti in forum Alpha Five Version 4
    Replies: 1
    Last Post: 09-29-2000, 09:09 AM
  5. Mark New Records
    By dtheo in forum Alpha Five Version 4
    Replies: 2
    Last Post: 09-27-2000, 05:24 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •