﻿<?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?)  » Childformdialog-problem</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 08 May 2026 16:08:13 GMT</lastBuildDate><ttl>20</ttl><item><title>Childformdialog-problem</title><link>http://forum.strataframe.net/FindPost32166.aspx</link><description>Hi There,&lt;br/&gt;&lt;br/&gt;there is a main form in my project, named lkunden with a BO called lkundenBO1. It contains a childformdialog-control set up to work with a child form named lkundneu, which also contains a BO named lkundenBO1. This is how I load the form:&lt;br/&gt;&lt;br/&gt;[code]&lt;br/&gt;&lt;br/&gt;&lt;font face=Consolas&gt;LKundenBO1.Add()&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;font color=#0000ff face=Consolas&gt;&lt;font color=#0000ff face=Consolas&gt;If&lt;/font&gt;&lt;/font&gt;&lt;font face=Consolas&gt; &lt;/font&gt;&lt;font color=#0000ff face=Consolas&gt;&lt;font color=#0000ff face=Consolas&gt;Me&lt;/font&gt;&lt;/font&gt;&lt;font face=Consolas&gt;.Childlkunden.ShowDialog() = DialogResult.OK &lt;/font&gt;&lt;font color=#0000ff face=Consolas&gt;&lt;font color=#0000ff face=Consolas&gt;Then&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face=Consolas&gt;&lt;/font&gt;&lt;font color=#0000ff face=Consolas&gt;&lt;font color=#0000ff face=Consolas&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font face=Consolas&gt; nLkunr &lt;/font&gt;&lt;font color=#0000ff face=Consolas&gt;&lt;font color=#0000ff face=Consolas&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font face=Consolas&gt; &lt;/font&gt;&lt;font color=#0000ff face=Consolas&gt;&lt;font color=#0000ff face=Consolas&gt;Integer&lt;/font&gt;&lt;/font&gt;&lt;font face=Consolas&gt; = NextIDBO1.nextid(&lt;/font&gt;&lt;font color=#a31515 face=Consolas&gt;&lt;font color=#a31515 face=Consolas&gt;"LKUNDEN"&lt;/font&gt;&lt;/font&gt;&lt;font face=Consolas&gt;) ' Another&amp;nbsp;BO with a function to call a sp to get an incremented value&lt;br/&gt;&lt;br/&gt;LKundenBO1.LKUNDENNR = nLkunr&lt;br/&gt;&lt;br/&gt;LKundenBO1.KUNDENNR = &lt;/font&gt;&lt;font color=#0000ff face=Consolas&gt;&lt;font color=#0000ff face=Consolas&gt;Me&lt;/font&gt;&lt;/font&gt;&lt;font face=Consolas&gt;.nKundennr&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;font color=#0000ff face=Consolas&gt;&lt;font color=#0000ff face=Consolas&gt;If&lt;/font&gt;&lt;/font&gt;&lt;font face=Consolas&gt; LKundenBO1.Save &amp;lt;&amp;gt; MicroFour.StrataFrame.Data.&lt;/font&gt;&lt;font color=#2b91af face=Consolas&gt;&lt;font color=#2b91af face=Consolas&gt;SaveUndoResult&lt;/font&gt;&lt;/font&gt;&lt;font face=Consolas&gt;.Success &lt;/font&gt;&lt;font color=#0000ff face=Consolas&gt;&lt;font color=#0000ff face=Consolas&gt;Then&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face=Consolas&gt;LKundenBO1.Undo(MicroFour.StrataFrame.Business.&lt;/font&gt;&lt;font color=#2b91af face=Consolas&gt;&lt;font color=#2b91af face=Consolas&gt;BusinessUndoType&lt;/font&gt;&lt;/font&gt;&lt;font face=Consolas&gt;.CurrentRowOnly)&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;font color=#0000ff face=Consolas&gt;&lt;font color=#0000ff face=Consolas&gt;End&lt;/font&gt;&lt;/font&gt;&lt;font face=Consolas&gt; &lt;/font&gt;&lt;font color=#0000ff face=Consolas&gt;&lt;font color=#0000ff face=Consolas&gt;If&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face=Consolas&gt;&lt;/font&gt;&lt;font color=#0000ff face=Consolas&gt;&lt;font color=#0000ff face=Consolas&gt;End&lt;/font&gt;&lt;/font&gt;&lt;font face=Consolas&gt; &lt;/font&gt;&lt;font color=#0000ff face=Consolas&gt;&lt;font color=#0000ff face=Consolas&gt;If&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;/font&gt;[/code]&lt;br/&gt;&lt;br/&gt;There is a new record added and I can enter values in the child form. When I leave the childform by setting&lt;br/&gt;&lt;br/&gt;the dialog result to ok and return to the main-form, the added record is lost. For example just before exiting from the main form I can control the count-property which is still correct but when I check it in the main form after the "showdialog-line", the added record has disappeared.&lt;br/&gt;&lt;br/&gt;Has anyboy an idea what is happening there?&lt;br/&gt;&lt;br/&gt;Best regards&lt;br/&gt;&lt;br/&gt;Thomas</description><pubDate>Wed, 31 Jul 2013 08:22:57 GMT</pubDate><dc:creator>Thomas Holste</dc:creator></item><item><title>RE: Childformdialog-problem</title><link>http://forum.strataframe.net/FindPost32170.aspx</link><description>I'm glad you got it working.</description><pubDate>Wed, 31 Jul 2013 08:22:57 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Childformdialog-problem</title><link>http://forum.strataframe.net/FindPost32168.aspx</link><description>Hi Ben,&lt;br/&gt;&lt;br/&gt;thank you for your help. I tried a bit further but did not find why the added record got lost so I dropped the childformdialog-control and replaced it by sending the BO as a parameter to the childform and set the BO and Bindings in the onload -event. A little bit more to type but now everything works as wanted.&lt;br/&gt;&lt;br/&gt;Best regards&lt;br/&gt;&lt;br/&gt;Thomas</description><pubDate>Wed, 31 Jul 2013 06:31:41 GMT</pubDate><dc:creator>Thomas Holste</dc:creator></item><item><title>RE: Childformdialog-problem</title><link>http://forum.strataframe.net/FindPost32167.aspx</link><description>I'm not sure on this one, Thomas. &amp;nbsp;It looks like there is a setting on the business object that might be undoing or clearing the business object when the child form closes. &amp;nbsp;I would try adding some event handlers to the business object to see if you can catch what the stack trace is when the DataTable is changing. &amp;nbsp;Try adding an event to the CurrentDataTableChanged event and put a break point there. &amp;nbsp;Then maybe BusinessRulesChecked, or BeforeUndo or one of those. &amp;nbsp;IsDirtyChanged would also be good since that will have to fire when the BO goes back to having no records, it won't be dirty any more. &amp;nbsp;If you can find out what the stack trace is when it's changing the BO, we can walk backwards to figure out what's clearing it out.</description><pubDate>Tue, 30 Jul 2013 10:05:02 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>