﻿<?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?)  » Move methods and filtering</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 03:08:56 GMT</lastBuildDate><ttl>20</ttl><item><title>Move methods and filtering</title><link>http://forum.strataframe.net/FindPost16243.aspx</link><description>I'm not sure if I'm doing something wrong or discovered a small bug.&lt;/P&gt;&lt;P&gt;I have two related business objects on a form, Tasks and TaskPredecessors.&amp;nbsp; I'm using 'MatchCurrentRow' on the ChildFilterRowMethod.&lt;/P&gt;&lt;P&gt;I am&amp;nbsp;executing a routine to populate the 'Tasks' BO based on data from&amp;nbsp;a temporary business object.&amp;nbsp;&amp;nbsp; Basically iterating through the temporary BO and creating new rows in the 'Tasks' BO.&amp;nbsp;&amp;nbsp; This works fine.&lt;/P&gt;&lt;P&gt;Once this routine has completed, I need to populate the 'TaskPredecessors' based on information in the Tasks BO. Basically I am creating dependencies between the tasks.&lt;/P&gt;&lt;P&gt;I am using a similar approach of&amp;nbsp;iterating the Tasks BO...If MoveFirst... MoveNext..&amp;nbsp; and creating new rows in the TaskPrecedessors BO, however I am getting an error on the NewRow&amp;nbsp; (Index 0 is either negative or above rows count).&lt;/P&gt;&lt;P&gt;I discovered that the Tasks filter property isn't changing as I iterate through the BO. The property holds the value of&amp;nbsp;the last row from the initial population.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Should the Move methods be changing the filter property according to the parent primary key?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tim</description><pubDate>Fri, 09 May 2008 09:20:49 GMT</pubDate><dc:creator>Tim Dol</dc:creator></item><item><title>RE: Move methods and filtering</title><link>http://forum.strataframe.net/FindPost16281.aspx</link><description>[codesnippet] have two related business objects on a form, Tasks and TaskPredecessors.&amp;nbsp; I'm using 'MatchCurrentRow' on the ChildFilterRowMethod.[/codesnippet]&lt;/P&gt;&lt;P&gt;Hey, Tim.&amp;nbsp; A couple of things here.&amp;nbsp; I will see if I can reproduce as I don't think there is an issue here...so there could be something funny with the relationship or something long those lines.&lt;/P&gt;&lt;P&gt;However, I would try something and change one of your processes.&amp;nbsp; You can definitely use the Move methods...I still have code that uses them, but you might want to start using the GetEnumerable() method on the BO:&lt;/P&gt;&lt;P&gt;[codesnippet]For Each bo As CustomersBO In MyCustomers.GetEnumerable()&lt;BR&gt;&amp;nbsp;'-- You can then reference each row strong typed via the bo instance&lt;BR&gt;&amp;nbsp;If bo.cust_LastName.Equals("SomeValue") Then &lt;BR&gt;&amp;nbsp;&amp;nbsp;'-- Do something else&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If &lt;BR&gt;Next[/codesnippet]&lt;/P&gt;&lt;P&gt;This method takes care of a lot of things for you such as saving off and restoring the current row index, etc.&amp;nbsp; Plus...it is faster, not massively, but every little bit counts :)&lt;/P&gt;&lt;P&gt;Next, manually set the filter on the child to see if your issue is resolved.&amp;nbsp; This is generally what I do anyway because I end up leaving the AutoFitler on half the time and end up chasing my tail later when I add a new record and things get funky on me :)&lt;/P&gt;&lt;P&gt;[codesnippet]MyChildBo.Filter = "MyChildField = " &amp;amp; MyParentBO.FilterValueField&lt;/P&gt;&lt;P&gt;'-- Place your for loop or Move code here&lt;/P&gt;&lt;P&gt;'-- Don't forget to reset the filter&lt;/P&gt;&lt;P&gt;MyChildBo.Filter = ""[/codesnippet]&lt;/P&gt;&lt;P&gt;Try that and see if your problem goes away.&amp;nbsp; It will at least be a good starting point.&lt;BR&gt;</description><pubDate>Fri, 09 May 2008 09:20:49 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Move methods and filtering</title><link>http://forum.strataframe.net/FindPost16279.aspx</link><description>I fully understand the parent / child concept.&amp;nbsp; The problem is the child records are not filtering correctly as I 'move' through the parent records.&amp;nbsp;</description><pubDate>Fri, 09 May 2008 08:25:15 GMT</pubDate><dc:creator>Tim Dol</dc:creator></item><item><title>RE: Move methods and filtering</title><link>http://forum.strataframe.net/FindPost16272.aspx</link><description>G'day&lt;/P&gt;&lt;P&gt;I believe that you may be missing the point of the parent child relationship between BOs (as I certainly did when I first started using them). If you have the parent child relationship set&amp;nbsp;up in the child BO, you don't have to populate the child BO based on what you have just populated the parent BO with, you just populate it with everything and strataframe takes care of the filtering.&lt;/P&gt;&lt;P&gt;Peter</description><pubDate>Thu, 08 May 2008 18:53:55 GMT</pubDate><dc:creator>Peter Denton</dc:creator></item></channel></rss>