﻿<?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?)  » Controlling BO Updates in a less than typical scenarios</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 22 May 2026 11:40:48 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Controlling BO Updates in a less than typical scenarios</title><link>http://forum.strataframe.net/FindPost32156.aspx</link><description>Thanks for&amp;nbsp;the mini time line.</description><pubDate>Thu, 11 Jul 2013 09:25:52 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>Controlling BO Updates in a less than typical scenarios</title><link>http://forum.strataframe.net/FindPost19682.aspx</link><description>I am currently evaluating SF as a framework for our migration to .NET&lt;BR&gt;I have played extensively with several other products over the past 6 months or so, and I was suprised when I did&amp;nbsp;stumble onto&amp;nbsp;SF that I hadn't come across it before.&lt;BR&gt;At first glance, it seems to me it should at least be holding as prominent a position as other tools such as IB,ES...&lt;P&gt;Anyway, I want to evaluate SF's capacity to adapt to some less than typical scenario's and I'd appreciate a heads-up from anyone who's willing.&lt;/P&gt;&lt;P&gt;Lets suppose I have a BO called IncidentBO, and I have it hooked up to an SF Maintenance Form.&lt;BR&gt;I want to allow the user to Add&amp;nbsp;a New or Edit an exisiting&amp;nbsp;Incident.&lt;/P&gt;&lt;P&gt;However, when the user saves an &lt;STRONG&gt;Edited&lt;/STRONG&gt; Incident, I want to leave the original row untouched and add a new row, which has the new details.&lt;BR&gt;I already have a PK structure that supports this. &lt;BR&gt;What I would like an insight into is where to hook the logic I would use and how to&amp;nbsp;turn the updated BO&amp;nbsp;into a new BO instance so it gets inserted.&lt;BR&gt;&lt;BR&gt;I think the answer to this will also give me an insight into some other questions I have.&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Geoff</description><pubDate>Thu, 11 Jul 2013 09:25:52 GMT</pubDate><dc:creator>geoffAtDatagaard</dc:creator></item><item><title>RE: Controlling BO Updates in a less than typical scenarios</title><link>http://forum.strataframe.net/FindPost32154.aspx</link><description>StrataFrame 2.0 is picking up more and more steam as we move forward.&amp;nbsp; We are still finishing up the core of StrataFrame 2.0 which is the most complicated and time consuming area.&amp;nbsp; It will be well worth the wait, though.&amp;nbsp; I am excited about using it as well on our other product lines (i.e. medical software).&amp;nbsp; As far as time lines, we may have a beta before Christmas, but there won't be an official release until at least the January.&amp;nbsp; It will be worth the wait though, I promise!</description><pubDate>Thu, 11 Jul 2013 09:19:53 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Controlling BO Updates in a less than typical scenarios</title><link>http://forum.strataframe.net/FindPost32153.aspx</link><description>Never a day goes by that I don't learn something new. Wow. And Version 2 somewhere Soon?</description><pubDate>Thu, 11 Jul 2013 09:05:43 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: Controlling BO Updates in a less than typical scenarios</title><link>http://forum.strataframe.net/FindPost32152.aspx</link><description>[quote][b]Terry Bottorff (7/10/2013)[/b][hr]So the second(temp) BO is its own Entity and its data does not get mixed with the original BO unless of course you choose to do so? Is that correct?[/quote]&lt;br/&gt;Yes, you are correct, you can have as many instances of the same BO in your form and they all be independent of each other.&amp;nbsp; Trust me, I have been amazed the more I work with SF of how flexible and useful the concept of using a BO is, and on top of that, you add all the useful methods and properties provided by SF to handle things like Filter, Sort, CurrentView and something that many may not be aware of BO.CurrentDataTable.AcceptChanges() method, in a table where you may have done many record changes and then you copy those records to another table, by calling the BO.CurrentDataTable.AcceptChanges() method will tell the BO not to complaint of the changes and ask to save the BO, very cool.</description><pubDate>Wed, 10 Jul 2013 22:21:23 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Controlling BO Updates in a less than typical scenarios</title><link>http://forum.strataframe.net/FindPost32151.aspx</link><description>Some days(months) I wonder where my brain is. So the second(temp) BO is its own Entity and its data does not get mixed with the original BO unless of course you choose to do so? Is that correct?&lt;br/&gt;&lt;br/&gt;TIA.</description><pubDate>Wed, 10 Jul 2013 22:10:21 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: Controlling BO Updates in a less than typical scenarios</title><link>http://forum.strataframe.net/FindPost32149.aspx</link><description>Hi Terry,&lt;br/&gt;&lt;br/&gt;[quote][b]Terry Bottorff (7/10/2013)[/b][hr]Edhy I see you use a "Temporary BO" in some of your forms. So does that mean you have a Temp table in your database or are you able to get a Temp BO some other way?TIA[/quote]&lt;br/&gt;&lt;br/&gt;No temporary table anywhere, just another instance of the BO either dropped in the form or programatically instantiated for the purpose on hand, here is a pseudo code:&lt;br/&gt;&lt;br/&gt;Suppose I have a BO or OrdenItemsBO in the form, and this is used to show the Order Items in a grid or listview, then I want to do some process in another instance of the same BO:&lt;br/&gt;&lt;span&gt;[codesnippet]&lt;br/&gt;Using TempBo As New &lt;/span&gt;&lt;span&gt;OrdenItemsBO&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&amp;nbsp; Now copy the records to the TempBO&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TempBO.CopyDataFrom(Me.&lt;/span&gt;&lt;span&gt;OrdenItemsBO1, Here the copy type required by SF)&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&amp;nbsp; Now I have all the records in the temp bo and I can do whatever I want, then save it and re-fill the &lt;/span&gt;&lt;span&gt;&lt;span&gt;OrdenItemsBO&lt;/span&gt;1 to show the changes&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For each TempBORecord in TempBO.GetEnumerable()&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Here do what you want with each record&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End For&lt;br/&gt;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If TempBO.IsDirty = True Then&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span&gt;TempBO.Save()&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.OrdenItemsBO1.FillAll()&lt;br/&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br/&gt;End Using&lt;br/&gt;[/codesnippet]&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;Again, above is just pseudo code from my head, not a real example.&amp;nbsp; And this would be needed in case you want to process some records from the whole list.&amp;nbsp; I also use a lot of BO.Filter conditions before copying the data to the TempBO, but be aware that when using BO.Filter or BO.Sort conditions, that these must be set to empty before adding new records, or your new records will not be included in the BO.CurrentView.</description><pubDate>Wed, 10 Jul 2013 18:59:22 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Controlling BO Updates in a less than typical scenarios</title><link>http://forum.strataframe.net/FindPost32148.aspx</link><description>Edhy I see you use a "Temporary BO" in some of your forms. So does that mean you have a Temp table in your database or are you able to get a Temp BO some other way?&lt;br/&gt;&lt;br/&gt;TIA</description><pubDate>Wed, 10 Jul 2013 18:45:56 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: Controlling BO Updates in a less than typical scenarios</title><link>http://forum.strataframe.net/FindPost32146.aspx</link><description>Hi Fabian,&lt;br/&gt;&lt;br/&gt;I am glad you were able to find the information you needed, that is exactly what the forums are for.&amp;nbsp; &lt;br/&gt;&lt;br/&gt;I keep using that technique over and over all the time, specially now that I am using the DevExpress Grid control via the SF Binding Source and when editing multiple records in a child form, could cause the records in the BO to go crazy and yield to the wrong data being saved, copying those records to another temporary BO and handling the data there and then re-fill the original one does the trick all the time and everybody is happy.&lt;br/&gt;&lt;br/&gt;Of course, sometimes with this trick there could be some sort of processing penalties, but in my case it is not noticeable for the end user.&amp;nbsp; Hope with the upcoming SF V2 binding to other controls like DevExpress could be done more naturally without a binding source.</description><pubDate>Wed, 10 Jul 2013 18:35:38 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Controlling BO Updates in a less than typical scenarios</title><link>http://forum.strataframe.net/FindPost32139.aspx</link><description>&lt;div&gt;&lt;font color="#000088" style="background-color: rgb(255, 238, 238);"&gt;Thanks Edhy for this old post. this saved me this time. something simple about how to update a BO was complicated to think and you give the correct solution, fill a BO with needed-to-update record, copy from that BO to actual BO, alter field as needed, save that and voila :)&lt;/font&gt;&lt;div&gt;&lt;font color="#000088" style="background-color: rgb(255, 238, 238);"&gt;&lt;br/&gt;&lt;/font&gt;&lt;div&gt;&lt;font color="#000088" style="background-color: rgb(255, 238, 238);"&gt;gracias nuevamente!&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;[quote][b]Edhy Rijo (9/25/2008)[/b][hr][quote][b]geoffAtDatagaard (09/25/2008)[/b][hr]I want to allow the user to Add&amp;nbsp;a New or Edit an existing&amp;nbsp;Incident. However, when the user saves an &lt;strong&gt;Edited&lt;/strong&gt; Incident, I want to leave the original row untouched and add a new row, which has the new details.&lt;br/&gt;I already have a PK structure that supports this. &lt;br/&gt;What I would like an insight into is where to hook the logic I would use and how to&amp;nbsp;turn the updated BO&amp;nbsp;into a new BO instance so it gets inserted.&lt;br/&gt;&lt;br/&gt;[/quote]&lt;br/&gt;&lt;br/&gt;Basically what I understand from your message above is the that when you Edit a record, actually you want to simply create a new one with the information of the edited one (a copied record).&amp;nbsp; That is pretty easy to accomplish by manipulating the primary bo Editing State and using the CopyData methods of the BO.&amp;nbsp; &lt;br/&gt;&lt;br/&gt;Of course such an action is not what I would consider a standard or common rule, so it would not be a straight forward path from the framework stand point, but it is doable as the framework is very flexible and allow you to go anywhere your business rules require.[/quote]</description><pubDate>Tue, 09 Jul 2013 12:19:34 GMT</pubDate><dc:creator>Fabian R Silva, -</dc:creator></item><item><title>RE: Controlling BO Updates in a less than typical scenarios</title><link>http://forum.strataframe.net/FindPost19767.aspx</link><description>We use scalar methods consistently within our medical software and StrataFrame provides a simple and straight forward way of executing scalare methods via the BO.&amp;nbsp; The business objects have an intrinsic method called ExecuteScalar that accepts all of the different command types or query texts depending on the immediate need.&amp;nbsp; But yes, scalar methods are very simple and easy to implement with SF.</description><pubDate>Fri, 26 Sep 2008 09:43:17 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Controlling BO Updates in a less than typical scenarios</title><link>http://forum.strataframe.net/FindPost19757.aspx</link><description>[quote][b]geoffAtDatagaard (09/25/2008)[/b][hr]Is there a&amp;nbsp;recommended best practise&amp;nbsp;for these types of queries in SF?&lt;BR&gt;I note that the BusinessLayer has an ExecuteScalar, so Im guessing that I should use that by adding GetServerNow to my ApBaseBO.&amp;nbsp;[/quote]&lt;P&gt;Hi,&lt;P&gt;Yes you are correct, the ExecuteScalar is the path for these types of queries.</description><pubDate>Fri, 26 Sep 2008 08:20:59 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Controlling BO Updates in a less than typical scenarios</title><link>http://forum.strataframe.net/FindPost19751.aspx</link><description>Thanks for that, much appreciated.&lt;/P&gt;&lt;P&gt;In most of our applications we also have a requirement to return a scalar value from the database, for example our current inhouse framework has a GetServerNow method which simply returns the current datetime from the database server.&amp;nbsp;&lt;BR&gt;Is there a&amp;nbsp;recommended best practise&amp;nbsp;for these types of queries in SF?&lt;BR&gt;I note that the BusinessLayer has an ExecuteScalar, so Im guessing that I should use that by adding GetServerNow to my ApBaseBO.&lt;/P&gt;&lt;P&gt;&lt;BR&gt;&amp;nbsp;</description><pubDate>Thu, 25 Sep 2008 22:59:46 GMT</pubDate><dc:creator>geoffAtDatagaard</dc:creator></item><item><title>RE: Controlling BO Updates in a less than typical scenarios</title><link>http://forum.strataframe.net/FindPost19690.aspx</link><description>Like Edhy mentioned, that is one option, but you could really go several different ways with this.&amp;nbsp; When you setup your development environment with SF we always recommend created a base BO (you can see and example of this in the StrataFlix sample).&amp;nbsp; Anyway, all you really would need to do is change the row in question from a Modifed record state to an Added record state and the BO will do the rest.&amp;nbsp; So if this is something common, you could place this logic in your base BO so you wouldn't have to recode this.&amp;nbsp; But in short, it would look something like this on a modified record:&lt;/P&gt;&lt;P&gt;[codesnippet]MyBo.CurrentRow.SetAdded()[/codesnippet]&lt;/P&gt;&lt;P&gt;That will change the row state from being in a edited state to being identified as a new record.&amp;nbsp; When updating the business layer will take this state into account.&amp;nbsp; There may be a few other things that I am not thinking of thqat you may have to tweak in regards to your PK (if you allow auto-incrementing PKs, etc.).&amp;nbsp; But it really would not be much more difficult than this.</description><pubDate>Thu, 25 Sep 2008 09:26:56 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Controlling BO Updates in a less than typical scenarios</title><link>http://forum.strataframe.net/FindPost19686.aspx</link><description>[quote][b]geoffAtDatagaard (09/25/2008)[/b][hr]I want to allow the user to Add&amp;nbsp;a New or Edit an existing&amp;nbsp;Incident. &lt;P&gt;However, when the user saves an &lt;STRONG&gt;Edited&lt;/STRONG&gt; Incident, I want to leave the original row untouched and add a new row, which has the new details.&lt;BR&gt;I already have a PK structure that supports this. &lt;BR&gt;What I would like an insight into is where to hook the logic I would use and how to&amp;nbsp;turn the updated BO&amp;nbsp;into a new BO instance so it gets inserted.&lt;BR&gt;&lt;BR&gt;[/quote]&lt;/P&gt;&lt;P&gt;Basically what I understand from your message above is the that when you Edit a record, actually you want to simply create a new one with the information of the edited one (a copied record).&amp;nbsp; That is pretty easy to accomplish by manipulating the primary bo Editing State and using the CopyData methods of the BO.&amp;nbsp; &lt;P&gt;Of course such an action is not what I would consider a standard or common rule, so it would not be a straight forward path from the framework stand point, but it is doable as the framework is very flexible and allow you to go anywhere your business rules require.</description><pubDate>Thu, 25 Sep 2008 08:33:45 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Controlling BO Updates in a less than typical scenarios</title><link>http://forum.strataframe.net/FindPost19683.aspx</link><description>BTW, I know I can do this using triggers in the back-end, this really is more of an exercise of exploration.</description><pubDate>Thu, 25 Sep 2008 02:06:14 GMT</pubDate><dc:creator>geoffAtDatagaard</dc:creator></item></channel></rss>