-------------- Original message ----------------------
From: johnf <[EMAIL PROTECTED]>
> On Tuesday 08 January 2008 08:39:26 am Adrian Klaver wrote:
> >  save() calls saveAll() on your primary bizObject.
> >
> > Actually looking at the code, save() from a bizobj calls saveAll() of the
> > child objs if the bizobj.save() is successful.
> > The behavior you describe happens when you call save() from the form.
> 
> I'm not sure what you are saying.  I think your first sentence agrees with 
> me.  
> Maybe the issue is "primary bizObject".  I meant "primary bizObject" as in 
> the BizObj you are working with - not "self.Form.PrimaryBizobj".  
> 
> 
> 
> -- 
> John Fabiani
> 
> 
Part of the problem was the primary designation. However my distinction still
holds even if we are talking about the bizobj you are working with. 
I will try to let the code speak for me:
bizobj.save()
def save(self, startTransaction=True):
        """Save any changes that have been made in the current row.

        If the save is successful, the saveAll() of all child bizobjs will be
        called as well.
        """

bizobj.saveAll()
def saveAll(self, startTransaction=True):
    """Saves all changes to the bizobj and children."""

form.save()
def save(self, dataSource=None):
        """ Ask the bizobj to commit its changes to the backend."""
<snip>
if self.SaveAllRows:
                bizobj.saveAll()
            else:
                bizobj.save()
<snip>

A save() called from a bizobj only saves changes to the current row and 
child bizobjs associated with that row. A saveAll() called from a bizobj saves
all changes to the bizobj and its children. So calling save() from a bizobj 
does not
call saveAll() on that object, only on its children.
When save() is called from a form its behavior is dependent on the SaveAllRows 
setting.
This is where I was mistaken in my original post, as I assumed it always did a
bizobj.saveAll().
--
Adrian Klaver
[EMAIL PROTECTED]

 


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]

Reply via email to