﻿<?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?)  » Add record from ListView using a ChildForm</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:05:15 GMT</lastBuildDate><ttl>20</ttl><item><title>Add record from ListView using a ChildForm</title><link>http://forum.strataframe.net/FindPost22671.aspx</link><description>Hi&lt;/P&gt;&lt;P&gt;I will try to explain this the more simple that I can:&lt;/P&gt;&lt;P&gt;I have a ListView that has a BO named PublicationsBO, the ListView has the usual Add, Edit, Delete buttons. I can add and edit records without problem using the ChildFormDialog.&lt;/P&gt;&lt;P&gt;The ChildForm has also a ListView that has ProductsForPublicationsBO, the relationships are setup and configured, I add a record manually and I can view in List and edit that record using another ChildFormDialog.&lt;/P&gt;&lt;P&gt;My problem is that if I add a new record to the ProductsForPublicationsBO the ParentKey field is not added -remains in 0 - so, this record is not realted to any Publication&lt;/P&gt;&lt;P&gt;In this same app, I use relationships, ChildFormDialogs but in all previous cases that dialogs are called from an MaintenanceForm, not from a ListView form - ChildForm. In all&amp;nbsp;of those, the&amp;nbsp;Parentkey is added by SF without problems.&lt;/P&gt;&lt;P&gt;Can you tell me how to add a new child correctly from a ChildForm?&lt;/P&gt;&lt;P&gt;Maybe StrataFlix does this, but I can not follow that sample because almost is done&amp;nbsp;by code, and I'm not so good trying to addapt the ideas there.&lt;/P&gt;&lt;P&gt;Regards&amp;nbsp;</description><pubDate>Wed, 08 Apr 2009 12:05:53 GMT</pubDate><dc:creator>Juan Carlos Pazos</dc:creator></item><item><title>RE: Add record from ListView using a ChildForm</title><link>http://forum.strataframe.net/FindPost22681.aspx</link><description>Edhy&lt;/P&gt;&lt;P&gt;Thanks, I add this and works:&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;FONT size=2&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Protected&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;Overrides&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;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; OnLoad(&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 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 size=2&gt; System.EventArgs)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;MyBase&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.OnLoad(e)&lt;/P&gt;&lt;P&gt;PublicacionesProductosBO1.ParentBusinessObject = PublicacionesBO1&lt;/P&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;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;[/codesnippet]&lt;/P&gt;&lt;P&gt;Regards</description><pubDate>Wed, 08 Apr 2009 12:05:53 GMT</pubDate><dc:creator>Juan Carlos Pazos</dc:creator></item><item><title>RE: Add record from ListView using a ChildForm</title><link>http://forum.strataframe.net/FindPost22680.aspx</link><description>[quote][b]Juan Carlos Pazos (04/08/2009)[/b][hr]Hi Trent&lt;br&gt;
&lt;br&gt;
[quote]override the Onload of the child form[/quote]&lt;br&gt;
&lt;br&gt;
How do I override the onload? I never done this before. &lt;br&gt;
&lt;br&gt;
Regards[/quote]&lt;br&gt;
Hi Juan Carlos&lt;br&gt;
Just start typing overrides, follow Intellisense and choose the method you want to override, in this case the OnLoad().</description><pubDate>Wed, 08 Apr 2009 11:35:51 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Add record from ListView using a ChildForm</title><link>http://forum.strataframe.net/FindPost22679.aspx</link><description>Hi Trent&lt;/P&gt;&lt;P&gt;[quote]override the Onload of the child form[/quote]&lt;/P&gt;&lt;P&gt;How do I override the onload? I never done this before. &lt;/P&gt;&lt;P&gt;Regards</description><pubDate>Wed, 08 Apr 2009 11:06:48 GMT</pubDate><dc:creator>Juan Carlos Pazos</dc:creator></item><item><title>RE: Add record from ListView using a ChildForm</title><link>http://forum.strataframe.net/FindPost22673.aspx</link><description>Juan,&lt;/P&gt;&lt;P&gt;This could be due to the translations AFTER the BOs translated.&amp;nbsp; For grins, override the Onload of the child form.&amp;nbsp; After the MyBase.OnLoad() call, reset the instances of the relationship and I bet it will resolve your error.&amp;nbsp; The issue could be that the relationship is still referencing the original instance instead of the translated instance.&lt;/P&gt;&lt;P&gt;[codesnippet]MyBase.OnLoad()&lt;BR&gt;MyChildBo.ParentBusinessObject = MyparentBo[/codesnippet]</description><pubDate>Wed, 08 Apr 2009 08:44:15 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Add record from ListView using a ChildForm</title><link>http://forum.strataframe.net/FindPost22672.aspx</link><description>Hi Juan Carlos,&lt;br&gt;
&lt;br&gt;
In the help file search by "RegisterForeignKey", then take a look at the topic "Defining a Relationship Between Business Objects".&lt;br&gt;
Probably you will need to manually assign the FK using the BO.RegisterForeingKey() method.</description><pubDate>Wed, 08 Apr 2009 08:11:44 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item></channel></rss>