﻿<?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 » WinForms (How do I?)  » BO Error Validation</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 15 Sep 2026 06:12:20 GMT</lastBuildDate><ttl>20</ttl><item><title>BO Error Validation</title><link>http://forum.strataframe.net/FindPost25061.aspx</link><description>I have a BO that has logic to automatically display broken rules. On the form, in the BO BeforeSave event the code automatically populates several columns and then I need to fire off the check rules on the BO. It appears as though the BO check rules is being fired before the "BeforeSave" event of the BO on the form. Is my assumption correct? If so, how can I check the rules in the BeforeSave event and if an error cancel the SAVE and display the error? Also, this only occurs when I am adding a NEW row to the table. When editing an existing row, the broken rule displays.</description><pubDate>Fri, 30 Oct 2009 10:21:54 GMT</pubDate><dc:creator>Ross L. Rooker, Sr.</dc:creator></item><item><title>RE: BO Error Validation</title><link>http://forum.strataframe.net/FindPost25071.aspx</link><description>Thanks. It is helpful to know that by the time the BeforeSave occurs on the BO, that the Broken Rules have already been checked. I just added my default logic into the BO &lt;FONT size=2&gt;CheckRulesOnCurrentRow&lt;/FONT&gt;to run ahead of the of the code that generates the &lt;FONT size=2&gt;AddBrokenRule.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I would have put this logic into the SetDefaultValues except, I do cannot run that logic until the user fully fills out the form, then when they click on SAVE I can then run my default logic which then lets me know if certain rules required the user to enter other information.</description><pubDate>Fri, 30 Oct 2009 10:21:54 GMT</pubDate><dc:creator>Ross L. Rooker, Sr.</dc:creator></item><item><title>RE: BO Error Validation</title><link>http://forum.strataframe.net/FindPost25062.aspx</link><description>[quote]Is my assumption correct?[/quote]&lt;/P&gt;&lt;P&gt;Yes.&lt;/P&gt;&lt;P&gt;[quote]If so, how can I check the rules in the BeforeSave event and if an error cancel the SAVE and display the error?[/quote]&lt;/P&gt;&lt;P&gt;You will want to handle the BusinessRulesChecked event as this will give you what you need and allow you to even force a save if you so choose.</description><pubDate>Thu, 29 Oct 2009 21:38:14 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>