﻿<?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?)  » BeforeDelete Event Issue</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 09:27:57 GMT</lastBuildDate><ttl>20</ttl><item><title>BeforeDelete Event Issue</title><link>http://forum.strataframe.net/FindPost19900.aspx</link><description>Hi SF Team,&lt;/P&gt;&lt;P&gt;When I set the e.cancel&amp;nbsp; = True &amp;nbsp;in the BeforeDelete event, it&amp;nbsp;is&amp;nbsp;NOT stopping the Deletion Comfirmation Dialog from showing to&amp;nbsp;the end user.&lt;IMG title=Crazy src="http://forum.strataframe.net/Skins/Classic/Images/MessageIcons/Crazy.gif" align=absMiddle&gt;&amp;nbsp; Although, when&amp;nbsp;the user does&amp;nbsp;click&amp;nbsp;OK, it does NOT delete the record.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jeff&lt;/P&gt;&lt;P&gt;Below is the code:&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;Private&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; CreditMemosBO1_BeforeDelete(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; e &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; MicroFour.StrataFrame.Business.BeforeDeleteEventArgs) &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Handles&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; CreditMemosBO1.BeforeDelete&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;CType&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.CreditMemosBO1.ApprovedByEmployeeID, Int32) &amp;gt; 0 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;MessageBox.Show(&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;&lt;FONT color=#800000 size=2&gt;"Unable to delete."&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &amp;amp; vbCrLf &amp;amp; vbCrLf &amp;amp; &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;&lt;FONT color=#800000 size=2&gt;"The credit memo has been approved."&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;&lt;FONT color=#800000 size=2&gt;"System Notification"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, MessageBoxButtons.OK, MessageBoxIcon.Information)&lt;/P&gt;&lt;P&gt;e.Cancel = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;True&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;ElseIf&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;CType&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.CreditMemosBO1.GLExportByUserID, Int32) &amp;gt; 0 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;MessageBox.Show(&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;&lt;FONT color=#800000 size=2&gt;"Unable to delete."&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &amp;amp; vbCrLf &amp;amp; vbCrLf &amp;amp; &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;&lt;FONT color=#800000 size=2&gt;"The credit memo has been exported to the accounting system."&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;&lt;FONT color=#800000 size=2&gt;"System Notification"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, MessageBoxButtons.OK, MessageBoxIcon.Information)&lt;/P&gt;&lt;P&gt;e.Cancel = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;True&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;</description><pubDate>Wed, 08 Oct 2008 08:56:29 GMT</pubDate><dc:creator>Jeff Pagley</dc:creator></item><item><title>RE: BeforeDelete Event Issue</title><link>http://forum.strataframe.net/FindPost19956.aspx</link><description>No sweat! Glad you got it working :D</description><pubDate>Wed, 08 Oct 2008 08:56:29 GMT</pubDate><dc:creator>Dustin Taylor</dc:creator></item><item><title>RE: BeforeDelete Event Issue</title><link>http://forum.strataframe.net/FindPost19954.aspx</link><description>Hi Dustin/Trent,&lt;/P&gt;&lt;P&gt;You are right.&amp;nbsp; Sorry about the confusion!&lt;A id=ctlPanelBar_ctlEmotIcons_ctl26_hypEmotIconImage &amp;#111;nclick="if_InsertEmotIconFromPopup(':blush:')" href="http://forum.strataframe.net/Skins/Classic/Dialogs/InsertEmotIcon.aspx?ControlID=txtPost#"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" src="http://forum.strataframe.net/Skins/Classic/Images/EmotIcons/Blush.gif"&gt;&lt;/A&gt;&amp;nbsp; It is working properly now.&lt;/P&gt;&lt;P&gt;As always, thank you for the great support and patience.&lt;/P&gt;&lt;P&gt;Jeff</description><pubDate>Wed, 08 Oct 2008 08:15:26 GMT</pubDate><dc:creator>Jeff Pagley</dc:creator></item><item><title>RE: BeforeDelete Event Issue</title><link>http://forum.strataframe.net/FindPost19920.aspx</link><description>Judging by your code sample you aren't :). Trent wasn't referring to handling the instance of the BO on the form rather than the base BO itself, he was referring to handling the form object's BeforeDelete event.&lt;/P&gt;&lt;P&gt;This is the first line of your code sample:&lt;/P&gt;&lt;P&gt;[codesnippet]Private Sub CreditMemosBO1_BeforeDelete(ByVal e As MicroFour.StrataFrame.Business.BeforeDeleteEventArgs) Handles [b][i]CreditMemosBO1[/i][/b].BeforeDelete[/codesnippet]&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;It should read as such, where "MyForm" is the name of your form:&lt;/P&gt;&lt;P&gt;[codesnippet]Private Sub CreditMemosBO1_BeforeDelete(ByVal e As MicroFour.StrataFrame.Business.BeforeDeleteEventArgs) Handles [b][i]MyForm[/b][/i].BeforeDelete[/codesnippet]&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Tue, 07 Oct 2008 08:52:58 GMT</pubDate><dc:creator>Dustin Taylor</dc:creator></item><item><title>RE: BeforeDelete Event Issue</title><link>http://forum.strataframe.net/FindPost19919.aspx</link><description>Hey Jeff.&lt;/P&gt;&lt;P&gt;I might have misunderstood what you meant, by that link showed you that the confirmation message will show up anyway if set to do it. So, you might want to turn the "AutoShowDeleteConfirmation" property in the form to False and then provide your own confirmation message in the BeforeDelete, according to your conditions.&lt;/P&gt;&lt;P&gt;Sorry if I still didn't get it. ;)</description><pubDate>Tue, 07 Oct 2008 08:48:53 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: BeforeDelete Event Issue</title><link>http://forum.strataframe.net/FindPost19918.aspx</link><description>Hi Trent,&lt;/P&gt;&lt;P&gt;Unfortunately, it is on the form where I am handling the BeforeDelete event.&amp;nbsp; By the way, I tried it on two different forms and the same thing is happenning.&amp;nbsp; FYI, I am using the MaintenanceFormToolStrip.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jeff</description><pubDate>Tue, 07 Oct 2008 07:54:40 GMT</pubDate><dc:creator>Jeff Pagley</dc:creator></item><item><title>RE: BeforeDelete Event Issue</title><link>http://forum.strataframe.net/FindPost19911.aspx</link><description>If you are handling this on the BO then that could be true.&amp;nbsp; But if you handle this on the form, then it should not show the auto-deletion confirmation.&amp;nbsp; Remember the form level events that exist on the form that mirror the BOs, you might try and place your logic there in this case to see if it resolves your problem.</description><pubDate>Mon, 06 Oct 2008 13:21:00 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: BeforeDelete Event Issue</title><link>http://forum.strataframe.net/FindPost19908.aspx</link><description>Hi Ivan,&lt;/P&gt;&lt;P&gt;To be honest, I already saw that post and I'm not sure how it applies to the problem I have.&amp;nbsp; I just want the business object to work as design.&amp;nbsp; In other words, when I set the e.cancel to true in the BeforeDelete event, I want to stop the deletion process as it says it should.&amp;nbsp; My problem is the Deletion Confirmation dialog is still appearing to the end user which it should not if I understand correctly on how it works.</description><pubDate>Mon, 06 Oct 2008 12:59:58 GMT</pubDate><dc:creator>Jeff Pagley</dc:creator></item><item><title>RE: BeforeDelete Event Issue</title><link>http://forum.strataframe.net/FindPost19905.aspx</link><description>Hi Jeff.&lt;/P&gt;&lt;P&gt;Have a look at the posts starting from here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://forum.strataframe.net/FindPost7946.aspx"&gt;http://forum.strataframe.net/FindPost7946.aspx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.</description><pubDate>Mon, 06 Oct 2008 11:43:26 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item></channel></rss>