﻿<?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's BeforeSave Event</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 12:20:37 GMT</lastBuildDate><ttl>20</ttl><item><title>BO's BeforeSave Event</title><link>http://forum.strataframe.net/FindPost464.aspx</link><description>In the BeforeSave event on my BO I am adding records to a secondary table using another BO.&amp;nbsp; This secondary BO is adding the records correctly,&amp;nbsp; but it appears that the BeforeSave event on the primary BO is fireing twice.&amp;nbsp; Any suggestion on what I should be checking.&lt;/P&gt;&lt;P&gt;Scott</description><pubDate>Thu, 26 Jan 2006 12:35:59 GMT</pubDate><dc:creator>Scott</dc:creator></item><item><title>RE: BO's BeforeSave Event</title><link>http://forum.strataframe.net/FindPost482.aspx</link><description>No problem, we'll get the install rebuilt and posted as soon as we can :)</description><pubDate>Thu, 26 Jan 2006 12:35:59 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: BO's BeforeSave Event</title><link>http://forum.strataframe.net/FindPost481.aspx</link><description>Thanks for the update.&amp;nbsp; Works great.</description><pubDate>Thu, 26 Jan 2006 10:43:10 GMT</pubDate><dc:creator>Scott</dc:creator></item><item><title>RE: BO's BeforeSave Event</title><link>http://forum.strataframe.net/FindPost477.aspx</link><description>Hehe, events are special... it's quite difficult to debug them.  Within the framework, where we call RaiseEvent, you can step into the line and you will step into all of the methods attached to that event.&lt;br&gt;
&lt;br&gt;
BTW, the update is posted on the Developers Blog.</description><pubDate>Thu, 26 Jan 2006 09:48:33 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: BO's BeforeSave Event</title><link>http://forum.strataframe.net/FindPost475.aspx</link><description>Great.&amp;nbsp; Nice to know I am not going crazy and starting to understand&amp;nbsp;how the framework works.&amp;nbsp; How would&amp;nbsp;you debug something like an event anyway?&amp;nbsp; I wouldn't even know the first place to start.&lt;/P&gt;&lt;P&gt;Scott</description><pubDate>Wed, 25 Jan 2006 10:25:41 GMT</pubDate><dc:creator>Scott</dc:creator></item><item><title>RE: BO's BeforeSave Event</title><link>http://forum.strataframe.net/FindPost473.aspx</link><description>OK, found the problem... there was an event that was being raised from within the DataLayer, not the BusinessLayer, and it was getting bubbled up and re-raised from within the BusinessLayer.  I'll get the update posted on the Developers blog shortly (running all of my unit tests right now) and then we'll get the install rebuilt.&lt;br&gt;
&lt;br&gt;
So, no, your concept of the BeforeSave event is the same as our concept of the BeforeSave event... it should only be firing once.</description><pubDate>Wed, 25 Jan 2006 08:47:46 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: BO's BeforeSave Event</title><link>http://forum.strataframe.net/FindPost472.aspx</link><description>Did not find any duplicate handlers.&amp;nbsp; Try this,&amp;nbsp; I went to the Strataframe sample windows application and added a beforesave event by double clicking on the event in the property sheet.&amp;nbsp; I then put the following code in the event:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;System.Console.WriteLine(&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"Before Save Event"&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;run the form, locate a record, click the edit button, (do nothing) click the save button, and look in the console, there is two "Before Save Event" messages. Is this the expected result?&amp;nbsp; I hope I just am not miss-understanding how the event is supposed to work.&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Tue, 24 Jan 2006 13:33:14 GMT</pubDate><dc:creator>Scott</dc:creator></item><item><title>RE: BO's BeforeSave Event</title><link>http://forum.strataframe.net/FindPost470.aspx</link><description>Within your InitializeComponent() method, of the business object, you should find a line similar to:&lt;br&gt;
&lt;br&gt;
this.BeforeSave += new BeforeSaveEventHandler(SFCategoryBO_BeforeSave);&lt;br&gt;
&lt;br&gt;
Make sure you don't have two of those lines.&lt;br&gt;
&lt;br&gt;
Also, are you doing anything special like using the business object on a child form that's shown through a ChildFormDialog, or within a UserControl?&lt;br&gt;
&lt;br&gt;
I've checked, and there's no place that the event is being raised twice, but it's possible that the event handler is being added twice...</description><pubDate>Tue, 24 Jan 2006 12:46:01 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: BO's BeforeSave Event</title><link>http://forum.strataframe.net/FindPost468.aspx</link><description>I am using a Maintenance form and the only thing that is set on the BO is the required fields collection.&amp;nbsp; Here are some of the methods on the BO itself.&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt;&lt;FONT color=#000000&gt; SFCategoryBO_CheckRulesOnCurrentRow(&lt;/FONT&gt;&lt;SPAN style="COLOR: teal"&gt;CheckRulesEventArgs&lt;/SPAN&gt;&lt;FONT color=#000000&gt; e)&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT color=#000000&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt;&lt;FONT color=#000000&gt; (!&lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;&lt;FONT color=#000000&gt;.CategoryDescriptionIsUnique())&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;&lt;FONT color=#000000&gt;.AddBrokenRule(&lt;/FONT&gt;&lt;SPAN style="COLOR: teal"&gt;SFCategoryBOFieldNames&lt;/SPAN&gt;&lt;FONT color=#000000&gt;.CatDesc,&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;Localization&lt;/SPAN&gt;&lt;FONT color=#000000&gt;.RetrieveTextValue(&lt;/FONT&gt;&lt;SPAN style="COLOR: maroon"&gt;"DuplicateCategoryDescription"&lt;/SPAN&gt;&lt;FONT color=#000000&gt;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT color=#000000&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt;&lt;FONT color=#000000&gt; SFCategoryBO_SetDefaultValues()&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT color=#000000&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;&lt;FONT color=#000000&gt;.Created = &lt;/FONT&gt;&lt;SPAN style="COLOR: teal"&gt;DateTime&lt;/SPAN&gt;&lt;FONT color=#000000&gt;.Now;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;&lt;FONT color=#000000&gt;.CreatedUsrID = &lt;/FONT&gt;&lt;SPAN style="COLOR: teal"&gt;oApp&lt;/SPAN&gt;&lt;FONT color=#000000&gt;.oUser.UserID;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT color=#000000&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt;&lt;FONT color=#000000&gt; SFCategoryBO_BeforeSave(MicroFour.StrataFrame.Data.&lt;/FONT&gt;&lt;SPAN style="COLOR: teal"&gt;BeforeSaveUndoEventArgs&lt;/SPAN&gt;&lt;FONT color=#000000&gt; e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT color=#000000&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT color=#000000&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;System.&lt;/FONT&gt;&lt;SPAN style="COLOR: teal"&gt;Console&lt;/SPAN&gt;&lt;FONT color=#000000&gt;.WriteLine(&lt;/FONT&gt;&lt;SPAN style="COLOR: maroon"&gt;"Before Save Event - "&lt;/SPAN&gt;&lt;FONT color=#000000&gt; + &lt;/FONT&gt;&lt;SPAN style="COLOR: teal"&gt;DateTime&lt;/SPAN&gt;&lt;FONT color=#000000&gt;.Now.ToString());&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT color=#000000&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;&lt;FONT color=#000000&gt;.LastUpd = &lt;/FONT&gt;&lt;SPAN style="COLOR: teal"&gt;DateTime&lt;/SPAN&gt;&lt;FONT color=#000000&gt;.Now;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;&lt;FONT color=#000000&gt;.LastUpdUsrID = &lt;/FONT&gt;&lt;SPAN style="COLOR: teal"&gt;oApp&lt;/SPAN&gt;&lt;FONT color=#000000&gt;.oUser.UserID;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT color=#000000&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I end up with two "Before Save Event" messages in the console.</description><pubDate>Tue, 24 Jan 2006 10:07:01 GMT</pubDate><dc:creator>Scott</dc:creator></item><item><title>RE: BO's BeforeSave Event</title><link>http://forum.strataframe.net/FindPost465.aspx</link><description>Are you saving through the form, or directly on the BO?  Maybe you could post a little code snippet of where you're actually calling the save and how your business objects are configured...</description><pubDate>Tue, 24 Jan 2006 08:45:01 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>