﻿<?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?)  » BO.Add doesn't FilterChildRecords</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sat, 16 May 2026 11:03:38 GMT</lastBuildDate><ttl>20</ttl><item><title>BO.Add doesn't FilterChildRecords</title><link>http://forum.strataframe.net/FindPost20510.aspx</link><description>Hi,&lt;br&gt;
I found that, BOAdd() doesn't filter child record. Is it by design?&lt;br&gt;
I also found that, previously BO.Add() will call navigate() method which will also FilterChildRecords. However, it is remarked and replace with ForceNavigatedAndBoundRefresh() which doesn't filterchildrecords.&lt;br&gt;
&lt;br&gt;
Please advice. Personally, I think Add() should auto filterchildrecords as well.&lt;br&gt;
&lt;br&gt;
Thank you</description><pubDate>Wed, 12 Nov 2008 09:18:49 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: BO.Add doesn't FilterChildRecords</title><link>http://forum.strataframe.net/FindPost20724.aspx</link><description>[quote]Is it the originally problem?[/quote]&lt;/P&gt;&lt;P&gt;No.&amp;nbsp; And I will throw your next question in here as well, a GUID would not resolve the problem.&amp;nbsp; The problem is that if a filter is applied, let's say on a foreign key contraint, and a new record is added to the child BO, that new record will be immediately hidden the instant that it is created because of that filter.&amp;nbsp; This is just how ADO.NET views work.&amp;nbsp; So in order to get around this problem, remove the filter, add the child record and set the default values (i.e. the foreign key contraint column) and then reapply the filter and you will be OK.</description><pubDate>Wed, 12 Nov 2008 09:18:49 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: BO.Add doesn't FilterChildRecords</title><link>http://forum.strataframe.net/FindPost20713.aspx</link><description>Hi,&lt;br&gt;
I think I used to face the problem whereby, the newly added child record, would be missing. it happens if AutoIncrement approach used to generate PK value. Is it the originally problem?&lt;br&gt;
&lt;br&gt;
If so, Guid assignment in SetDefaultValues() should not cause the problem .. even though I call FilterCHildRecords() after ParentBO.Add(), am I right?&lt;br&gt;
&lt;br&gt;
Thank you</description><pubDate>Tue, 11 Nov 2008 20:22:13 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: BO.Add doesn't FilterChildRecords</title><link>http://forum.strataframe.net/FindPost20562.aspx</link><description>Trent's point is that things can get confusing when you try to add a record with a filter applied. His suggestion is to:&lt;/P&gt;&lt;P&gt;1)&amp;nbsp;Remove the&amp;nbsp;filter on the BO before adding a record. i.e. BusinessObject.Filter = ""&lt;/P&gt;&lt;P&gt;2) Add the record&lt;/P&gt;&lt;P&gt;3) Re-apply the filter after the record is saved. i.e. BusinessObject.Filter = "&amp;lt;Your filter here&amp;gt;"&lt;/P&gt;&lt;P&gt;If you then have a child filter record you need to re-apply, then yes, you would do it after the add. But when adding any child records, I would still recommend removing the filter from the child BOs before performing the add.</description><pubDate>Wed, 05 Nov 2008 10:20:27 GMT</pubDate><dc:creator>Dustin Taylor</dc:creator></item><item><title>RE: BO.Add doesn't FilterChildRecords</title><link>http://forum.strataframe.net/FindPost20532.aspx</link><description>Hi,&lt;br&gt;
I still not get it. Shall you explain in more details?&lt;br&gt;
If I manually call FilterChildRecords() after call Add(), would it cause any issue?&lt;br&gt;
&lt;br&gt;
Thank you</description><pubDate>Mon, 03 Nov 2008 18:58:10 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: BO.Add doesn't FilterChildRecords</title><link>http://forum.strataframe.net/FindPost20514.aspx</link><description>Yes, by design.&amp;nbsp; If you look around the forum you will see that this has been a common topic in the past.&amp;nbsp; Generally from people having navigation issues because a filter is applied, a new record is added, and then the new record is not the current index.&lt;/P&gt;&lt;P&gt;The filter &lt;STRONG&gt;&lt;EM&gt;&lt;U&gt;is&lt;/U&gt;&lt;/EM&gt;&lt;/STRONG&gt; respected on the add, but if you add a new record, you must set the columns that are part of the filter in order for the new record to show up where you expect it to be.&amp;nbsp; This is why we always recommend removing the filter prior to an add, set the columns that are part of the filter, then re-apply the filter.</description><pubDate>Mon, 03 Nov 2008 09:11:19 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>