﻿<?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?)  » Refreshing/Refilling a business object</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Mon, 18 May 2026 13:50:42 GMT</lastBuildDate><ttl>20</ttl><item><title>Refreshing/Refilling a business object</title><link>http://forum.strataframe.net/FindPost11743.aspx</link><description>What's the best way to refresh the data in a business object?&amp;nbsp; I know you can just call the fill method over again, but I have a situation where this is not going to work.&amp;nbsp; I am in edit mode on my form, but I have a few un-editable values on the form which may change.&amp;nbsp; If the values update I want it to reflect on the form.&amp;nbsp; If I call the fill method, it will take it out of edit mode and back to idle.&amp;nbsp; Is there a good way to do this?&amp;nbsp; I thought about having one business object linked to the values I want to be able to refresh, and one that just links off to the editable values that won't refresh. When I need to refresh and they are in edit mode, I only refresh the one business object.&amp;nbsp; When in idle, it would refresh both.&amp;nbsp; Is this the right way of thinking about it??</description><pubDate>Fri, 28 Sep 2007 15:03:32 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Refreshing/Refilling a business object</title><link>http://forum.strataframe.net/FindPost11757.aspx</link><description>Sounds good, Andria. :) Let me know if you need more details.</description><pubDate>Fri, 28 Sep 2007 15:03:32 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Refreshing/Refilling a business object</title><link>http://forum.strataframe.net/FindPost11751.aspx</link><description>I'm going to attempt to try what Trent has suggested.&amp;nbsp; I think I follow, but I may get stuck at some point so expect to see me back here asking another question :D</description><pubDate>Fri, 28 Sep 2007 09:53:46 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Refreshing/Refilling a business object</title><link>http://forum.strataframe.net/FindPost11750.aspx</link><description>Well, sorry to rain on the parade but I can't use SQL 2005 specific methods.&amp;nbsp; Our application has to stay database neutral so that we can support Oracle and SQL.&amp;nbsp; Thanks for the answers though.&amp;nbsp;</description><pubDate>Fri, 28 Sep 2007 09:49:12 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Refreshing/Refilling a business object</title><link>http://forum.strataframe.net/FindPost11748.aspx</link><description>Andria,&lt;/P&gt;&lt;P&gt;Peter has a good idea and this is the purpose of a query notification.&amp;nbsp; But the one thing that would happen is that when you receive the query notification you will still have to call a Fill method of some kind.&amp;nbsp; What I would do, as you had mentioned, is create a separate instance of a BO and call the Fill on that BO.&amp;nbsp; Then if records are returned, you can filter out any duplicate records or records that have been modified on your edit BO.&amp;nbsp; Once you have the filter on the second BO the way you like it, call the CopyDataFrom method on the primary BO and pass it eh secondary BO and use the AppendFromDefaultView option.&amp;nbsp; This would probably be the best solution for what you are trying to accomplish.</description><pubDate>Fri, 28 Sep 2007 09:40:19 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Refreshing/Refilling a business object</title><link>http://forum.strataframe.net/FindPost11744.aspx</link><description>G'day&lt;/P&gt;&lt;P&gt;To find out if you need to refresh you could use the ReceiveQueryNotifications method on the BO. Here's a snippet from the Documentation:&lt;/P&gt;&lt;H3&gt;ReceiveQueryNotifications&lt;/H3&gt;&lt;P&gt;The ReceiveQueryNotifications property determines whether a System.Data.SqlClient.SqlDependency will set to listen for Query &lt;FONT style="BACKGROUND-COLOR: #0a246a" color=#ffffff&gt;Notifications&lt;/FONT&gt; that are registered on commands executed through FillDataTable(). When &lt;FONT style="BACKGROUND-COLOR: #0a246a" color=#ffffff&gt;notifications&lt;/FONT&gt; are received, the ServerDataChanged method is raised allowing you to repopulate the business object due to changes within the server's data.&lt;/P&gt;&lt;DIV class=Notes&gt;&lt;B&gt;Note:&lt;/B&gt; To use Query &lt;FONT style="BACKGROUND-COLOR: #0a246a" color=#ffffff&gt;Notifications&lt;/FONT&gt;, you must adhere to the following requirements: &lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;SQL Server 2005 only &lt;LI&gt;Properly formatted queries - Queries must follow the rules for a proper Indexed View query. See the Microsoft Developer's Guide for more information. &lt;LI&gt;Enable the broker &lt;FONT style="BACKGROUND-COLOR: #0a246a" color=#ffffff&gt;service&lt;/FONT&gt; (ALTER DATABASE [database] SET ENABLE_BROKER) on the database.&lt;/LI&gt;&lt;/UL&gt;&lt;P class=Notes&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=Notes&gt;Once you've determined that you need to refresh perhaps you could &lt;/P&gt;&lt;P class=Notes&gt;1. If necessary save the current changes &lt;/P&gt;&lt;P class=Notes&gt;if MyBO.IsDirty then MyBO.Save&lt;/P&gt;&lt;P class=Notes&gt;2. Determine which row in the table you're in&lt;/P&gt;&lt;P class=Notes&gt;Dim MyRow as Integer = MyBO.CurrentRowIndex&lt;/P&gt;&lt;P class=Notes&gt;3. Refill the BO by whatever means&lt;/P&gt;&lt;P class=Notes&gt;4. Get back to where you were&lt;/P&gt;&lt;P class=Notes&gt;MyBO.Navigate(&lt;FONT size=2&gt;MicroFour.StrataFrame.Business.BusinessNavigationDirection.Absolute, MyRow)&lt;/P&gt;&lt;/FONT&gt;&lt;P class=Notes&gt;5. Get back into edit mode&lt;/P&gt;&lt;P class=Notes&gt;MyBO.Edit()&lt;/P&gt;&lt;P class=Notes&gt;Hope this helps. I haven't used the ReceiveQueryNotifications property, but I read about it some time ago and thought it might be useful.&lt;/P&gt;&lt;P class=Notes&gt;Peter</description><pubDate>Thu, 27 Sep 2007 19:37:49 GMT</pubDate><dc:creator>Peter Denton</dc:creator></item></channel></rss>