﻿<?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?)  » Conflict between interface and database logic. Need help (idea)</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 07:02:36 GMT</lastBuildDate><ttl>20</ttl><item><title>Conflict between interface and database logic. Need help (idea)</title><link>http://forum.strataframe.net/FindPost27466.aspx</link><description>Hi,&lt;br&gt;
I have for example 2 tables with 1-to-1 relation.&lt;br&gt;
When I add record to Master table - INSERT trigger add record to SLAVE table&lt;br&gt;
&lt;br&gt;
Now I have a form where data from 2 tables present.&lt;br&gt;
When I click "NEW" toobar button I must be able to modify data like all fields located in same table.&lt;br&gt;
For this reason I have 2 BO on the form and set of textboxes with data binging.&lt;br&gt;
&lt;br&gt;
Problem begins when I click "SAVE"&lt;br&gt;
&lt;br&gt;
When I save MASTER table - trigger automatically creates record in SLAVE table, and when I call SAVE() for child BO - I have key duplicates.&lt;br&gt;
&lt;br&gt;
I try to create instance of same BO and try to make MergeFrom() but data is not updated.&lt;br&gt;
&lt;br&gt;
Need idea, how to be in this case.. what the best solution for it?&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
Denis</description><pubDate>Thu, 17 Jun 2010 12:08:26 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Conflict between interface and database logic. Need help (idea)</title><link>http://forum.strataframe.net/FindPost27478.aspx</link><description>Hi Dennis,&lt;/P&gt;&lt;P&gt;You may have a good reason for using a trigger on your master table, but if you are always adding&amp;nbsp;a slave (child) object on the same form whenever you add a master (parent) object, you may be better off using the SF parent/child functionality to maintain a one-to-one relationship. This would eliminate the save issue you are currently seeing. Of course if your application allows a parent object to be added by itself on a form or by other means and you need to ensure that a default child object is also added, the trigger would be the way to go.&lt;/P&gt;&lt;P&gt;-Larry</description><pubDate>Thu, 17 Jun 2010 12:08:26 GMT</pubDate><dc:creator>Larry Caylor</dc:creator></item><item><title>RE: Conflict between interface and database logic. Need help (idea)</title><link>http://forum.strataframe.net/FindPost27474.aspx</link><description>I basically enumerate the BO and change the status like this:&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
For Each StockBO As bizTransactionItemsStock In Me.BizTransactionItemsStock1.GetEnumerable()&lt;br&gt;
                If StockBO.CurrentRow.RowState &lt;&gt; Data.DataRowState.Modified Then&lt;br&gt;
                    StockBO.CurrentRow.SetModified()&lt;br&gt;
                End If&lt;br&gt;
            Next&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
In the above sample bizTransactionItemsStock1 is the BO.</description><pubDate>Thu, 17 Jun 2010 10:44:39 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Conflict between interface and database logic. Need help (idea)</title><link>http://forum.strataframe.net/FindPost27471.aspx</link><description>Hi,&lt;br&gt;
In my case it should not be added.. it must be 'modified'.. &lt;br&gt;
&lt;br&gt;
The problem is.. my BO on the form has one "ADDED" row.. but after MASTER table .SAVE() - the record appears in SLAVE TABLE by trigger.. &lt;br&gt;
When I save SLAVE BO - then I have error with duplicate records.&lt;br&gt;
&lt;br&gt;
When I copy data to another instance of BO and try to save its not commit changes after MergeDataFrom()&lt;br&gt;
even if I call Edit() and change property SetDirtyOnEdit true.&lt;br&gt;
&lt;br&gt;
How can I change the rowstate? This property is ReadOnly&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
Denis</description><pubDate>Thu, 17 Jun 2010 10:26:30 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Conflict between interface and database logic. Need help (idea)</title><link>http://forum.strataframe.net/FindPost27469.aspx</link><description>[quote][b]dgsoft (06/17/2010)[/b][hr]The idea with MergeDataFrom() maybe not bad in this case.. but - it does not bring changes to the database after Save() (but in debugger I can see updated CurrentDataTable with new values). Why?[/quote]&lt;br&gt;
&lt;br&gt;
Hi Denis,&lt;br&gt;
&lt;br&gt;
Probably the row state is being reset like in some cases of CopyDataFrom() and you may need to enumerate the BO and set the row state to "adding".</description><pubDate>Thu, 17 Jun 2010 10:15:09 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Conflict between interface and database logic. Need help (idea)</title><link>http://forum.strataframe.net/FindPost27468.aspx</link><description>The idea with MergeDataFrom() maybe not bad in this case.. but - it does not bring changes to the database after Save() (but in debugger I can see updated CurrentDataTable with new values). Why?</description><pubDate>Thu, 17 Jun 2010 08:48:50 GMT</pubDate><dc:creator>dgsoft</dc:creator></item></channel></rss>