NetTalk Central

Author Topic: Parent/Child Issue  (Read 2146 times)

wasatchconsulting

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
    • Email
Parent/Child Issue
« on: February 09, 2020, 01:37:52 PM »
I am trying to get a parent/child process working. I have followed example 25, but I must be missing something. I add a new parent record and all is well if I just save the record without trying to add a child record. If I start to add a parent record and then add a child record (without clicking on the save button of the parent first), the record is auto incremented and the child shows the correct parent ID, but as soon as I save the child record, it returns back to the parent record, the parent record now has a new ID and of course no child records show. If I try to save the parent record, it returns back to the child record page instead of the parent list. If you try to cancel, it goes back to the parent update page with a new ID and if you try to click on the cancel on the parent it returns back to the child page. It is in an endless loop. I can use the browser back button to get back to the parent list page, but now it has saved several parent records and clicking on delete does not delete anything and clicking on change gives me a fetch error.

I can upload the file to review if needed. Just don't know what I am doing wrong.

Thanks
Ken Watts

Jane

  • Sr. Member
  • ****
  • Posts: 349
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: Parent/Child Issue
« Reply #1 on: February 09, 2020, 05:25:34 PM »
Just as a generic comment, Ken....  if you truly mean auto-incrementing as in LONGs configured that way in the dictionary...  that's not the best paradigm.

Particularly if you start looking at doing mobile apps down the road, you're better off having a GUID as a primary key.

I can't speak to the specific example you're working with.  But if you prime the GUID in the parent, you then know what it's going to be and can use that GUID as the link for child records.  Then when you finally save the parent, everything should match up.

Cheers,

Jane

wasatchconsulting

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
    • Email
Re: Parent/Child Issue
« Reply #2 on: February 11, 2020, 06:19:57 AM »
I must have had something that I just could not see that was the problem. I am in the early stages, so I just recreated the whole process and now it is working as expected.

Thanks
Ken Watts