﻿<?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  » Cancel Events?</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sun, 31 May 2026 22:33:09 GMT</lastBuildDate><ttl>20</ttl><item><title>Cancel Events?</title><link>http://forum.strataframe.net/FindPost3639.aspx</link><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;I'm looking for an easy and consistent&amp;nbsp;way for a BO to notify the UI that an Add, Delete, Save, or Undo has been canceled. &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;Having corresponding “Canceled” events to&amp;nbsp;these methods would&amp;nbsp;be one solution.&amp;nbsp;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;The event arguments would be similar to the existing After events except that a&lt;/SPAN&gt; “message” item would need to be added to the Before and&amp;nbsp;Canceled events to allow the developer to include a reason the method was canceled.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;Currently I'm including logic in the form that I feel should really be in the BO because there is nothing in the framework (at least I haven't found it) to communicate to the UI that a method was cancelled in the BO and why. There&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt; may be a better way of doing this in the current framework that I haven’t thought of, and if so, I’m open to suggestions.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;One other thing I noticed while thinking about this is that the BO Save methods are overridable while the Delete methods are not. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;I’d like to see them marked overridable to allow the developer to extend them if necessary.&amp;nbsp;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;-Larry&lt;/SPAN&gt;&lt;/SPAN&gt;</description><pubDate>Wed, 18 Oct 2006 08:14:19 GMT</pubDate><dc:creator>Larry Caylor</dc:creator></item><item><title>RE: Cancel Events?</title><link>http://forum.strataframe.net/FindPost3663.aspx</link><description>I've already flagged them and they will be in the next release :)</description><pubDate>Wed, 18 Oct 2006 08:14:19 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Cancel Events?</title><link>http://forum.strataframe.net/FindPost3660.aspx</link><description>OK I've got my inherited custom business layer and the functionality I want. If you'll just mark the BO delete methods as Overridable I won't have to mess with the SF source code.&lt;/P&gt;&lt;P&gt;-Larry</description><pubDate>Tue, 17 Oct 2006 18:52:07 GMT</pubDate><dc:creator>Larry Caylor</dc:creator></item><item><title>RE: Cancel Events?</title><link>http://forum.strataframe.net/FindPost3654.aspx</link><description>No, that's a perfectly valid reason to have that sort of functionality.&amp;nbsp; However, with our time constraints and the other feature requests we still have pending, you will probably be more pleased by overriding the BeforeDelete to implement the functionality on your own.&amp;nbsp; &lt;/P&gt;&lt;P&gt;And yes, we cram everything we can into the business objects... there's just no reason to have the UI contain logic like that, so you are definitely on the right track.</description><pubDate>Mon, 16 Oct 2006 16:41:42 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Cancel Events?</title><link>http://forum.strataframe.net/FindPost3653.aspx</link><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;Hi Ben,&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;The reason for the request was to handle the following type of situation.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.2in; TEXT-INDENT: -0.15in; mso-list: l0 level1 lfo1; tab-stops: list .2in"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;Business Rule: You cannot delete a customer that has related orders.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.2in; TEXT-INDENT: -0.15in; mso-list: l0 level1 lfo1; tab-stops: list .2in"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;Business rule is enforced by a foreign key relationship in the database&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.2in; TEXT-INDENT: -0.15in; mso-list: l0 level1 lfo1; tab-stops: list .2in"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;Using the SF maintenance form if you try to delete a customer with related order records you get an ugly exception error. While it might be possible to capture the exception and display a friendlier message you shouldn’t be relying on exceptions to enforce your business rules and therefore some additional logic is required.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.2in; TEXT-INDENT: -0.15in; mso-list: l0 level1 lfo1; tab-stops: list .2in"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;Create a public method on the customer BO to check for related records.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.2in; TEXT-INDENT: -0.15in; mso-list: l0 level1 lfo1; tab-stops: list .2in"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;Use the maintenance form’s BeforeDelete event to access the public method on the BO and if there are related records, generate a friendly message to the user and cancel the delete.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;While using the form's BeforeDelete event works, I felt that checking for related records and canceling the delete is a business rule that should be handled by the business object and not the form. The problem is that there is no facility within the framework for the BO to inform the UI that it canceled the delete and provide a reason. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;Currently if you use the BO's BeforeDelete event and cancel the delete within the BO, the records aren’t deleted and the only information accessible to the UI is that zero records were deleted (I didn’t actually check to see if DeleteCurrentRow() returns 0 if the delete is canceled but I assume that is what happens).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;There may be multiple business rules that prevent a record from being deleted, so just informing the user that nothing was deleted is not very informative.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;Although I can certainly provide the functionality the user expects using SF as is, I’ve always tried to keep the UI as dumb as possible and place all the smarts in the BO. I know I’m probably being overly picky but it comes from reading too many books like Expert One-On-One Visual Basic .NET Business Objects.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;-Larry&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;</description><pubDate>Mon, 16 Oct 2006 16:38:21 GMT</pubDate><dc:creator>Larry Caylor</dc:creator></item><item><title>RE: Cancel Events?</title><link>http://forum.strataframe.net/FindPost3649.aspx</link><description>Unfortunately you're the first person to mention it... most everyone just wants to be able to cancel, but they don't care about why they were canceled.</description><pubDate>Mon, 16 Oct 2006 15:28:43 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Cancel Events?</title><link>http://forum.strataframe.net/FindPost3648.aspx</link><description>A custom business layer&amp;nbsp;did occur&amp;nbsp;to me. I just wanted to see if there was any interest before I started down that path.&lt;/P&gt;&lt;P&gt;-Larry</description><pubDate>Mon, 16 Oct 2006 15:25:44 GMT</pubDate><dc:creator>Larry Caylor</dc:creator></item><item><title>RE: Cancel Events?</title><link>http://forum.strataframe.net/FindPost3641.aspx</link><description>Marking the Delete methods as overridable is easy... we can certainly do that.&amp;nbsp; However, adding the functionality for a message and a cancel reason might be more than we want to support.&amp;nbsp; However, you could create an inherited BusinessLayer that has the proper functionality by overriding the OnBefore* methods and raising your own event rather than the base BusinessLayer event.&amp;nbsp; You could then raise&amp;nbsp;a Cancelled event from the same place, right after you raise your own event if the Cancel has been set to true.</description><pubDate>Mon, 16 Oct 2006 13:59:00 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>