﻿<?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 » Enhancement Requests  » SetDirtyOnAdd</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 19 May 2026 06:12:43 GMT</lastBuildDate><ttl>20</ttl><item><title>SetDirtyOnAdd</title><link>http://forum.strataframe.net/FindPost7177.aspx</link><description>We would like a new SetDirtyOnAdd property that works just like the SetDirtyOnEdit property for business objects.&amp;nbsp; If a user clicks to add a record and never actually enters any data, when they close the screen we don't want to show the save changes confirmation message.&amp;nbsp; Is this possible?</description><pubDate>Mon, 26 Mar 2007 14:18:52 GMT</pubDate><dc:creator>Brad Vick</dc:creator></item><item><title>RE: SetDirtyOnAdd</title><link>http://forum.strataframe.net/FindPost7703.aspx</link><description>As mentioned above, if you have this need you can implement it yourself.&amp;nbsp; The GetFldState is replaced in ADO.NET by looking at the version of the field, which you can do just like you did in FoxPro.&amp;nbsp; All fields in ADO.NET have a buffer, this is how concurrency works.&lt;/P&gt;&lt;P&gt;[codesnippet]MyBO.CurrentRow.Item("MyField",Version....)[/codesnippet]</description><pubDate>Mon, 26 Mar 2007 14:18:52 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: SetDirtyOnAdd</title><link>http://forum.strataframe.net/FindPost7692.aspx</link><description>This is where Foxpro's getfldstate() -function would come VERY handy, as it shows the add -status &lt;EM&gt;as well&lt;/EM&gt; as the buffer status.&amp;nbsp; Would be nice if the framework would provide this at some point or another.&amp;nbsp; It really is a nit, but customers can be real nit-picky about this kind of stuff -- they want as speedy of a UI experience as possible with as few alerts as (safely) possible.&amp;nbsp; This is one of those.&lt;/P&gt;&lt;P&gt;Pertti</description><pubDate>Mon, 26 Mar 2007 11:33:17 GMT</pubDate><dc:creator>Pertti Karjalainen</dc:creator></item><item><title>RE: SetDirtyOnAdd</title><link>http://forum.strataframe.net/FindPost7587.aspx</link><description>This is obviously much more difficult since you are truly adding a new record to the data table within the BO.&amp;nbsp; Without looping ADO.NET has no way of telling nor does the BO since we rely on the ADO.NET row to tell us the state.&lt;/P&gt;&lt;P&gt;Editing is entirely different because a row already exists, so it is just a matter of not setting the row state to anything and just letting nature take it's course.&amp;nbsp; When adding a new row, you have to have something to put values into ... so you HAVE to create a new row.&lt;/P&gt;&lt;P&gt;The only two options I see for you is to either write a method to loop....or drop on a second BO which all of the fields are bound to.&amp;nbsp; Then use a second BO as your "permanent" BO which has the data from the editing BO copied into it using the CopyDataFrom method on the BO in the BeforeSave or AfterSave and where you feel you need to make the transition.&amp;nbsp; This will require more work but would allow you to have the "clean" row.&amp;nbsp; In any case, you are going to have to create this logic yourself as the BOs and ADO.NET do not have a method to do this natively.</description><pubDate>Mon, 19 Mar 2007 11:25:37 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: SetDirtyOnAdd</title><link>http://forum.strataframe.net/FindPost7586.aspx</link><description>&lt;br&gt;
&lt;br&gt;
Yes, I want to know if they user actually typed in anything.  Just like on an edit when 'SetDirtyOnEdit' is false, dirty does not become true until the user changes something.  I was trying to avoid the brute force method of looping over all the fields.</description><pubDate>Mon, 19 Mar 2007 11:20:09 GMT</pubDate><dc:creator>Brad Vick</dc:creator></item><item><title>RE: SetDirtyOnAdd</title><link>http://forum.strataframe.net/FindPost7585.aspx</link><description>So what is your criteria to determine if a record is "truly dirty?"&amp;nbsp; Are you trying to determine if they typed in anything at all?&amp;nbsp; In that case you will have to enumerate the fields to see if anything has been modified....or turn of the AutoSaveChagnesMessage and handle this yourself.</description><pubDate>Mon, 19 Mar 2007 11:15:25 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: SetDirtyOnAdd</title><link>http://forum.strataframe.net/FindPost7584.aspx</link><description>&lt;br&gt;
&lt;br&gt;
The row state is 'Add' regardless of whether or not the user enters anything.  It becomes add as soon as I execute an .Add() on the BO.</description><pubDate>Mon, 19 Mar 2007 11:12:10 GMT</pubDate><dc:creator>Brad Vick</dc:creator></item><item><title>RE: SetDirtyOnAdd</title><link>http://forum.strataframe.net/FindPost7582.aspx</link><description>Why can't you just look at the row state?&amp;nbsp; This will tell you what is going on with the current row.&lt;/P&gt;&lt;P&gt;[codesnippet]MyBO.CurrentRow.RowState[/codesnippet]</description><pubDate>Mon, 19 Mar 2007 11:01:34 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: SetDirtyOnAdd</title><link>http://forum.strataframe.net/FindPost7580.aspx</link><description>&lt;br&gt;
&lt;br&gt;
Is there something else I can look at on the BO to determine if the current row is truly dirty?  I don't want to ask the user to save changes on exiting a form if they have not changed anything.  The IsDirtyOnEdit property works great for editing, but I need to do the same type of thing for adding.</description><pubDate>Mon, 19 Mar 2007 10:57:29 GMT</pubDate><dc:creator>Brad Vick</dc:creator></item><item><title>RE: SetDirtyOnAdd</title><link>http://forum.strataframe.net/FindPost7184.aspx</link><description>Well, a record has to be added so that the business object knows to INSERT it into the database.&amp;nbsp; If you add the new record and then save the changes, you would then have to know to set the record back to Added rather than Modified.&amp;nbsp; So, I'm not sure.&amp;nbsp; That's what the ICancelAddNew interface is for on the BusinessBindingSource, but that's really only used by grids.</description><pubDate>Mon, 26 Feb 2007 14:34:08 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>