﻿<?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?)  » How to append without seeing save changes</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 01:52:00 GMT</lastBuildDate><ttl>20</ttl><item><title>How to append without seeing save changes</title><link>http://forum.strataframe.net/FindPost17212.aspx</link><description>I attempting to update the current row after a save (to get the values of some calculated columns from SQL Server). I have a  method that uses AppendDataTable to update a single row. When this is called, the BO is dirtied and then I get a "do you want to save changes" message.  From the user's perspective, what they see is:&lt;br&gt;
&lt;br&gt;
- they save the record by clicking on "Save"&lt;br&gt;
- Then they are asked if they want to save changes (duh, like, of course I do...I just clicked "Save"!)&lt;br&gt;
&lt;br&gt;
Now, if they click Yes or No, it makes no difference, as the changes are fresh from the DB in any case.  Cancel makes no sense as I'm doing this in AfterSave and the form has already put the BO into idle state.&lt;br&gt;
&lt;br&gt;
So, what am I doing wrong here/how can I deal with this?</description><pubDate>Mon, 23 Jun 2008 08:18:46 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: How to append without seeing save changes</title><link>http://forum.strataframe.net/FindPost17234.aspx</link><description>Greg,&lt;/P&gt;&lt;P&gt;You might want to try an ImportRow or LoadDataRow since you have a record from a DataTable that you are trying to import.&amp;nbsp; You can specify whether or not to preserve the row state (which is sounds like in this case you wouldn't want to.&amp;nbsp; It may look something like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LoadDataRow:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;[codesnippet]'-- Create the values collection that will match the structure of the data table&lt;BR&gt;Dim myValues As Object() = New Object() {"Col1", 1234, DateTime.Now}&lt;BR&gt;&lt;BR&gt;'-- Insert (or update) the row with the values that you want.&amp;nbsp; &lt;BR&gt;MyBO.CurrentDataTable.LoadDataRow(myValues, LoadOption.OverwriteChanges)[/codesnippet]&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ImportRow:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;[codesnippet]Me.CurrentDataTable.ImportRow(MyTable.Rows(0))[/codesnippet]</description><pubDate>Mon, 23 Jun 2008 08:18:46 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: How to append without seeing save changes</title><link>http://forum.strataframe.net/FindPost17218.aspx</link><description>Yeah, I tried that. I tried to call it right after calling AppendDataTable().  Unfortunately, the message already occurred. I.e. the bo is dirtied by the AppendDataTable call (apparently), and user is prompted to save changes before it returns.</description><pubDate>Fri, 20 Jun 2008 17:39:24 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: How to append without seeing save changes</title><link>http://forum.strataframe.net/FindPost17217.aspx</link><description>How about calling the BO.&lt;FONT size=2&gt;CurrentDataTable.AcceptChanges() in the AfterSave().&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;That may not be the best fix, but it may buy you some time. ;)</description><pubDate>Fri, 20 Jun 2008 16:57:37 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: How to append without seeing save changes</title><link>http://forum.strataframe.net/FindPost17215.aspx</link><description>Yep. That is correct.  The specific line that causes the BO to become dirty again (after all, it was just saved), is the AppendDataTable call.</description><pubDate>Fri, 20 Jun 2008 16:29:01 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: How to append without seeing save changes</title><link>http://forum.strataframe.net/FindPost17213.aspx</link><description>Hi Greg,&lt;/P&gt;&lt;P&gt;I understand that in the AfterSave() event you have code to update the current row? If this is the case, then the BO.IsDirty will be True causing the ask to save message, right?</description><pubDate>Fri, 20 Jun 2008 15:27:40 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item></channel></rss>