Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Saving related recs on a form
Message
From
12/03/2002 13:32:43
 
 
To
22/02/2002 18:42:30
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, California, United States
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00622096
Message ID:
00631637
Views:
39
Thanks for all the info! My responses are below. I really appreciate it. Now we've got a new version of Mere Mortals to bone up on!

Sally


>OK, now I understand why the child obj records weren't saving... they were never created in the first place.
>
>Purely out of curiosity, why are you using arrays to store the child obj data?
>

A grid would have been my preferred method but the client would have none of that! Each child record has a description and an amount. If I need extra pages, I add them. The interface works great but obviously the data isn't getting saved.



>I guess the final answer to your question begins with a question... when do you want the child records created? It sounds as if you're waiting for a positive response from the parent obj's Save()?

That's right.

>
>If that's the case, I would suggest the parent obj's PostTransactionHook... that's the new method Kevin added that fires after the last transaction has been successfully ended.

Ok, I'll try this.

>
>The only reason the child biz obj's save won't work, is that the parent calls the child's IsChanged(), which checks to see if anything in the child obj's InitialSelectedAlias has been changed. Since you haven't added anything to the child obj's view yet, it will return .F. and the Save() will never be called. This is why you were never seeing the child obj's Save() fire in your original post.
>
>-Hope that didn't muddy the waters too much more than they already were!
>---J
>
>>Yup everything is set ok. I think my biggest problem here is that I don't know where to put code to save records on the secondary bizobj. I understand that its not being saved because I'm using arrays to enter in the data and of course the system wouldn't know that I want to save this data in separate records in the 2nd table. Do you know the best place to put the code to convert the array to records I can insert? I tried in the postsave of the primary bizobj but that didn't work. Can I put it in the save of the 2ndary bizobj even tho' no record is being directly saved from the data on the form?
>>
>>Thanks for your help!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform