﻿<?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?)  » How to prevent parent record being deleted?</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 16:02:26 GMT</lastBuildDate><ttl>20</ttl><item><title>How to prevent parent record being deleted?</title><link>http://forum.strataframe.net/FindPost1784.aspx</link><description>In my application has two business objects,&amp;nbsp;CustomerBO&amp;nbsp;and OrderBO. CustomerBO&amp;nbsp; is mapped to customer table and OrderBO is mapped to order table. CustomerBO is the parent business object of OrderBO. The reference integrity of customer and order tables not set in the database.&amp;nbsp; I want to prevent the application from deleting the record in customerBO if the record is referenced by orderBO records. May I know how the business object can prevent this deletion?</description><pubDate>Mon, 10 Jul 2006 08:41:35 GMT</pubDate><dc:creator>Wang Tong Yin</dc:creator></item><item><title>RE: How to prevent parent record being deleted?</title><link>http://forum.strataframe.net/FindPost1789.aspx</link><description>You can write a shared method on the OrdersBO that will get the count of the records within the database that have the given CustomersBO as their parent.&amp;nbsp; Then, simply handle the BeforeDelete event of the CustomersBO and if the count of the method returns &amp;gt; 0 then, set e.Cancel = True and show an error message.&amp;nbsp; That's the most efficient way to do it.</description><pubDate>Mon, 10 Jul 2006 08:41:35 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>