﻿<?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?)  » Object that could potentially have multiple parents.</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 03:13:31 GMT</lastBuildDate><ttl>20</ttl><item><title>Object that could potentially have multiple parents.</title><link>http://forum.strataframe.net/FindPost18424.aspx</link><description>Guys,&lt;P&gt;What is best practice for a scenario where you may have an object, that may have a different parent object depending on the form it is used in? For example, I have an object called parts. Parts can be called in my application to create a proposal (kind of sales order) of which I presently have 4 different types, they may also&amp;nbsp;be used in invoicing, they may also be used in Jobs, where again parts may be used for maintenance purposes.&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;Geoff Hirst</description><pubDate>Tue, 12 Aug 2008 10:13:44 GMT</pubDate><dc:creator>Geoff Hirst</dc:creator></item><item><title>RE: Object that could potentially have multiple parents.</title><link>http://forum.strataframe.net/FindPost18432.aspx</link><description>The Navigated event won't fire after a seektoprimary key since a seek doesn't update the bound controls (which is the difference between "navigate" and "move".) The seek method will return True or False based on whether it is successfull, so you could test on that and fire off whatever code you needed to in the same code block. &lt;/P&gt;&lt;P&gt;If you do want to update the UI, however, you can use the NavigateToPrimaryKey, which will fire the Navigated event upon completion :).</description><pubDate>Tue, 12 Aug 2008 10:13:44 GMT</pubDate><dc:creator>Dustin Taylor</dc:creator></item><item><title>RE: Object that could potentially have multiple parents.</title><link>http://forum.strataframe.net/FindPost18431.aspx</link><description>Trent,&lt;/P&gt;&lt;P&gt;Thanks for that chap, just what I needed.&lt;/P&gt;&lt;P&gt;Just another thing, should the naivgated event fire after a seektoprimarykey? Doesn't seem to be doing for me.&lt;/P&gt;&lt;P&gt;thanks for the help.&lt;/P&gt;&lt;P&gt;G.</description><pubDate>Tue, 12 Aug 2008 10:00:22 GMT</pubDate><dc:creator>Geoff Hirst</dc:creator></item><item><title>RE: Object that could potentially have multiple parents.</title><link>http://forum.strataframe.net/FindPost18427.aspx</link><description>If you are going to setup a relationship between the parent and the child, you may want to just manually use the RegisterForeignKey method.&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;FONT size=2&gt;&lt;/P&gt;&lt;P&gt;bo.RegisterForeignKey(MyChildBO,&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"ChildFieldName"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;[/codesnippet]&lt;/P&gt;&lt;P&gt;When doing this, you can dynamically change the relationship between the parent BO and the child BO.&amp;nbsp; This does, however, have to be done in code and will require that you set the value of the child field when a new record is created.&amp;nbsp; But once that is done, all of the same functionality as using the ParentRelationship logic will still work, including the automatic update of child FK values if the parent is a new record, etc.</description><pubDate>Tue, 12 Aug 2008 09:48:36 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>