Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One to many with Optimistic Table Buffering
Message
From
27/09/2001 21:16:01
 
 
To
27/09/2001 19:04:01
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00561751
Message ID:
00561780
Views:
14
>I'm using parent-child relationship (one to many) between two business objects in a cBizObjForm class based form (no page frames).
>
>The child business object works under buffer mode 5 (Table optimistic) in order to be prepared for displaying some extra needed data, which is replaced accordingly.
>
>When I execute a New operation (parent is the primary business object), I'm asked if I want to save changes first, because of the changed fields into the child business object.
>
>I'd like to hear opinions about the best way (framework way) to handle this. After checking the documentation, I've found that there is a lCascadeMessages properties that seems to be the one to provide a way around it. However I do not know if this could change the default expected behavior like "requery child when parent changes" or "save child on save parent", etc.
>
>I'm also thinking on using the SetFldState function in order to make the Ischanged() function return a .F. reply, but it does not seems to me as the best way to accomplish it the right way.
>
>Any hints are welcome.
>
>Thanks in advance and regards
>
>Oscar Corte

Ola Oscar,

You've raised some innnteresting questions. I'm not sure I can give you the right answer. But, lcascademessages is set to true by default, and it does affect the parent/child relationships for all the operations. What you could do is add a custom method in your bizobj called SetCascadeMessages() with a parameter to set this property from false to true and back again. Then I would simply copy the new() method from kBizobj to your subclass, insert a call to your custom method to set the lcascademessages to false in the beginning of the method and set it back again at the end.

Of course you could just set the property right inside the new method, but you may need to set it from outside your bizobj at some point or from other methods as well. Don't be afraid hack the subclasses, that's what they are for.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform