﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » When Parent.Save() should it apply Save to Children</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 17:47:13 GMT</lastBuildDate><ttl>20</ttl><item><title>When Parent.Save() should it apply Save to Children</title><link>http://forum.strataframe.net/FindPost19426.aspx</link><description>Hi,&lt;br&gt;
&lt;br&gt;
My form has parent object and 2 children objects (all the relationships set correctly, etc)&lt;br&gt;
On parent BO Navigated event I fill children by Parent PK (childBo.FillByParentPK(parentBO.PKID); ).&lt;br&gt;
&lt;br&gt;
But there was a problem parentBO.Save was executed (in edit mode); it was only saving parent's changes. I thought .Save on parent should propagate to children?&lt;br&gt;
&lt;br&gt;
So, I added:&lt;br&gt;
[codesnippet]&lt;br&gt;
parentBO.Save();&lt;br&gt;
Child1BO.Save();&lt;br&gt;
Child2BO.Save();&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
It works now, but I just want to make sure I am doing the right thing.&lt;br&gt;
&lt;br&gt;</description><pubDate>Tue, 16 Sep 2008 09:18:41 GMT</pubDate><dc:creator>Leonard P.</dc:creator></item><item><title>RE: When Parent.Save() should it apply Save to Children</title><link>http://forum.strataframe.net/FindPost19433.aspx</link><description>Yep, that will ceratinly work since calling the save on the form just calls the save on each business object that is a member of that form. &lt;/P&gt;&lt;P&gt;However, just to clear up some confusion, calling the save on the parent will &lt;EM&gt;not&lt;/EM&gt; automatically save the child. It &lt;EM&gt;will&lt;/EM&gt; propogate the parent's new PK (if there is a new PK) to the child's foreign key field so that when it &lt;EM&gt;is&lt;/EM&gt; saved everything will line up correctly.&lt;/P&gt;&lt;P&gt;If you call the save on the child, it &lt;EM&gt;will&lt;/EM&gt; call the save on the parent &lt;EM&gt;if&lt;/EM&gt; the parent IsDirty. So if you modify an existing parent record, or if you are working in a new parent record (the record will be dirty until it is saved the first time) &lt;EM&gt;then&lt;/EM&gt;&amp;nbsp;it will automatically call the save, otherwise it won't since it doesn't need to.</description><pubDate>Tue, 16 Sep 2008 09:18:41 GMT</pubDate><dc:creator>Dustin Taylor</dc:creator></item><item><title>RE: When Parent.Save() should it apply Save to Children</title><link>http://forum.strataframe.net/FindPost19431.aspx</link><description>Hi,&lt;br&gt;
&lt;br&gt;
I set all children's IncludeInFormSave property to true. So now in Save method, I am calling .Save on the form (this.Save() ) instead of on parent object, so is that correct approach?</description><pubDate>Tue, 16 Sep 2008 08:20:04 GMT</pubDate><dc:creator>Leonard P.</dc:creator></item><item><title>RE: When Parent.Save() should it apply Save to Children</title><link>http://forum.strataframe.net/FindPost19428.aspx</link><description>Hi Leonard,&lt;/P&gt;&lt;P&gt;If you set the ParentBusinessObject = your ParentBO, it should work as long as the IncludeInFormSave for each child BO is also True.&lt;/P&gt;&lt;P&gt;Take a look at the StrataFlix sample which shows this logic by editing 3 BOs and saving all of them in a single call.&lt;/P&gt;&lt;P&gt;If that does not work, you can also check the BO.IsDirty value to do the save for each child, until you figured out what is going on.&amp;nbsp; And make sure you are using the latest version 1.6.6.</description><pubDate>Mon, 15 Sep 2008 17:14:22 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: When Parent.Save() should it apply Save to Children</title><link>http://forum.strataframe.net/FindPost19427.aspx</link><description>Hey Leonard.&lt;/P&gt;&lt;P&gt;See if this one helps:&lt;/P&gt;&lt;P&gt;&lt;A href="http://forum.strataframe.net/FindPost15274.aspx"&gt;http://forum.strataframe.net/FindPost15274.aspx&lt;/A&gt;</description><pubDate>Mon, 15 Sep 2008 17:12:16 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item></channel></rss>