﻿<?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 / Business Objects and Data Access (How do I?)  / Copy Current Record / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>forum@strataframe.net</webMaster><lastBuildDate>Tue, 02 Dec 2008 16:44:28 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Copy Current Record</title><link>http://forum.strataframe.net/Topic13603-6-1.aspx</link><description>Here is my implementation of copying the current record into the same business object in a ListView control.&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;FONT size=2&gt; tsbCopyAndAddRecord_Click(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT size=2&gt; sender &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; System.Object, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT size=2&gt; e &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; System.EventArgs) &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Handles&lt;/FONT&gt;&lt;FONT size=2&gt; tsbCopyAndAddRecord.Click&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;     '-- If there is not item selected in the list, then &lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;     '-- instruct the user to select a record first.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;     &lt;/FONT&gt;If&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.lstItems.SelectedItems.Count = 0 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;          &lt;/FONT&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.ShowMessageByKey(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"SelectRecordToCopy"&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;          &lt;/FONT&gt;Exit&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;FONT color=#008000&gt;     &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#008000&gt;     &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;     &lt;/FONT&gt;Try&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;          '-- Save off the current row&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;          &lt;/FONT&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; copyRow &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; DataRow = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.BizItems1.CurrentRow&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;          &lt;/FONT&gt;If&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.BizItems1.NewRow() &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;               '-- Now update each of the columns within the new row.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;               &lt;/FONT&gt;For&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Each&lt;/FONT&gt;&lt;FONT size=2&gt; col &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; DataColumn &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;In&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.BizItems1.CurrentDataTable.Columns&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;                    '-- Skip the Primary Field, since the field is autoincremented or&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;                    '-- a generated GUID&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;                    &lt;/FONT&gt;If&lt;/FONT&gt;&lt;FONT size=2&gt; col.ColumnName = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.BizItems1.PrimaryKeyField &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;                         &lt;/FONT&gt;Continue&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;For&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;                    &lt;/FONT&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;                    '-- Do the actual copy of each field or column here.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;                    &lt;/FONT&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.BizItems1.CurrentRow(col) = copyRow(col)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;               &lt;/FONT&gt;Next&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;               '-- Show the ChildForm for the copied record.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;               &lt;/FONT&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.EditChildRecord()&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;          &lt;/FONT&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;     &lt;/FONT&gt;Catch&lt;/FONT&gt;&lt;FONT size=2&gt; ex &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; Exception&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;     &lt;/FONT&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Try&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;[/codesnippet]&lt;/P&gt;&lt;P&gt;In the above code I am using a method EditChildRecord() that I created from the source code of the listview, which I requested an enhancement to make this method public or shared here &lt;A href="http://forum.strataframe.net/Topic19108-9-1.aspx"&gt;http://forum.strataframe.net/Topic19108-9-1.aspx&lt;/A&gt; for this kind of functionality.  I am not including my version here since I hope it will be made available to use in the framework.</description><pubDate>Fri, 05 Sep 2008 11:03:42 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Copy Current Record</title><link>http://forum.strataframe.net/Topic13603-6-1.aspx</link><description>Thanks again, will follow your advice.</description><pubDate>Mon, 17 Mar 2008 13:54:56 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Copy Current Record</title><link>http://forum.strataframe.net/Topic13603-6-1.aspx</link><description>There is not a framework function to do this....you are really better off creating a shared method on a class somewhere that does this for you so you can "tweak" it to your needs.  When we started to add this method to the framework, we realized that there would have to be a LOT of overloads to try to accomodate this is a generic method.  It is still on our list, but not in the framework yet.  You can do this yourself very easily using the code supplied in the post.  I recommend created a sealed class to house all of your "basics" and then you could add a static (shared) method to that class to do this for you:&lt;/P&gt;&lt;P&gt;[codesnippet]Public NotInheritable Class MyBasics&lt;BR&gt;    '-- Seal the class&lt;BR&gt;    Private Sub New()&lt;BR&gt;    End Sub&lt;/P&gt;&lt;P&gt;   Public Shared Function CopyRecord(ByVal sourceRow As DataRow) As DataRow&lt;BR&gt;      '-- Add the logic from the previous post here with your "tweaks"&lt;BR&gt;   End Function&lt;BR&gt;End Class[/codesnippet]</description><pubDate>Mon, 17 Mar 2008 13:27:35 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Copy Current Record</title><link>http://forum.strataframe.net/Topic13603-6-1.aspx</link><description>[quote][b]Trent L. Taylor (03/17/2008)[/b][hr]I guess I don't know what you are referring to.  You can view the previous post I had here that shows how to copy a record: &lt;A href="http://forum.strataframe.net/FindPost13606.aspx"&gt;http://forum.strataframe.net/FindPost13606.aspx&lt;/A&gt; .  This sample code is in VB.NET.  We haven't added a method to the tools class for this.  &lt;P&gt;If this isn't what you are looking for then you might elaborate on what functionality you are trying to implement.[/quote]&lt;P&gt;Hi Trent,&lt;P&gt;Yes I am referring to the following code:&lt;P&gt;[codesnippet]&lt;PRE&gt;'-- Save off the current row&lt;BR&gt;Dim copyRow As DataRow = MyBo.CurrentRow&lt;BR&gt;MyBo.NewRow()&lt;P&gt;'-- Now update each of the columns within the new row.  You may want to test&lt;BR&gt;'    on certain column names to be excluded, such as PK fields.&lt;BR&gt;For each col as DataColumn In MyBo.CurrentDataTable.Columns&lt;BR&gt;    MyBo.Items(col.ColumnName) = copyRow.Item(col.ColumnName)        &lt;BR&gt;Next&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;[/codesnippet]&lt;P&gt;I just wanted to know if it was added to the framework so I could use it.  I have several address fields which could use this approach to be updated from an existing record.</description><pubDate>Mon, 17 Mar 2008 11:43:35 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Copy Current Record</title><link>http://forum.strataframe.net/Topic13603-6-1.aspx</link><description>I guess I don't know what you are referring to.  You can view the previous post I had here that shows how to copy a record: &lt;A href="http://forum.strataframe.net/FindPost13606.aspx"&gt;http://forum.strataframe.net/FindPost13606.aspx&lt;/A&gt; .  This sample code is in VB.NET.  We haven't added a method to the tools class for this.  &lt;/P&gt;&lt;P&gt;If this isn't what you are looking for then you might elaborate on what functionality you are trying to implement.</description><pubDate>Mon, 17 Mar 2008 10:59:04 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Copy Current Record</title><link>http://forum.strataframe.net/Topic13603-6-1.aspx</link><description>[quote][b]Trent L. Taylor (01/21/2008)[/b][hr]This is probably something we could add to the Tools.Common class, but just haven't as of yet.[/quote]&lt;/P&gt;&lt;P&gt;Hi Trent,&lt;/P&gt;&lt;P&gt;I am looking for the same functionality here but in VB, was this added to SF?</description><pubDate>Sun, 16 Mar 2008 20:36:06 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Copy Current Record</title><link>http://forum.strataframe.net/Topic13603-6-1.aspx</link><description>[quote][b]Ben Chase (01/24/2008)[/b][hr]try this instead:&lt;P&gt;partsBO1.CurrentRow[mCol] = mCurrentPart[mCol];[/quote]&lt;P&gt;I changed just the BO side per your earlier suggestion.  It seems to work just fine.  I do have the second half looking like this, though:&lt;P&gt;mCurrentPart[mCol.ColumnName]&lt;P&gt;I am assuming that ColumnName is the default property to DataColumn object.  So leaving it there or removing it won't matter, eh?</description><pubDate>Thu, 24 Jan 2008 09:28:10 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Copy Current Record</title><link>http://forum.strataframe.net/Topic13603-6-1.aspx</link><description>Woops, didn't look at the sample closely enough... didn't realize you were copying to a new record within the same business object... try this instead:&lt;/P&gt;&lt;P&gt;partsBO1.CurrentRow[mCol] = mCurrentPart[mCol];</description><pubDate>Thu, 24 Jan 2008 09:01:58 GMT</pubDate><dc:creator>Ben Chase</dc:creator></item><item><title>RE: Copy Current Record</title><link>http://forum.strataframe.net/Topic13603-6-1.aspx</link><description>[quote][b]Ben Chase (01/23/2008)[/b][hr]&lt;P&gt;partsBO1.CurrentRow[mCol] = mCurrentPart.CurrentRow[mCol.ColumnName];&lt;/P&gt;&lt;P&gt;[/quote]&lt;P&gt;Sorry...I am a bit confused.  A DataRow object doesn't have a CurrentRow property, does it?  I'll try using the CurrentRow of the BO to see if that makes a difference.</description><pubDate>Wed, 23 Jan 2008 13:28:46 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Copy Current Record</title><link>http://forum.strataframe.net/Topic13603-6-1.aspx</link><description>You cannot set a NULL value through the strong-typed property... and the .Item property (the indexer in C#, where you just use the []) uses those strong-typed properties.  In order to copy over the NULL values, you will need to bypass the strong-typed properties by using the .CurrentRow property like so:&lt;/P&gt;&lt;P&gt;In your foreach loop, change the:&lt;/P&gt;&lt;P&gt;partsBO1.&lt;FONT color=#ff1111&gt;Items&lt;/FONT&gt;(mCol.ColumnName) = mCurrentPart.&lt;FONT color=#ff1111&gt;Items&lt;/FONT&gt;(mCol.ColumnName);&lt;/P&gt;&lt;P&gt;to:&lt;/P&gt;&lt;P&gt;partsBO1.CurrentRow[mCol] = mCurrentPart.CurrentRow[mCol.ColumnName];&lt;/P&gt;&lt;P&gt;If you noticed, I used the column reference on the first and the column name on the second... that's because the fastest way to reference a column of a DataRow is by passing the column reference, but since the column belongs to the first BO and not the second, you have to use the name to reference the second one.  You could use the name on both, but then the DataRow would just use the name to find the column reference and then use it, so you might as well pass the column reference since you have it.</description><pubDate>Wed, 23 Jan 2008 09:15:38 GMT</pubDate><dc:creator>Ben Chase</dc:creator></item><item><title>RE: Copy Current Record</title><link>http://forum.strataframe.net/Topic13603-6-1.aspx</link><description>Here is the offending code:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;class&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Field_lentolerance_Descriptor&lt;/FONT&gt;&lt;FONT size=2&gt; : MicroFour.StrataFrame.Business.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;FieldPropertyDescriptor&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;{&lt;BR&gt;    &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; Field_lentolerance_Descriptor() : &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;base&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"lentolerance"&lt;/FONT&gt;&lt;FONT size=2&gt;) { }&lt;BR&gt;    &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; System.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Type&lt;/FONT&gt;&lt;FONT size=2&gt; _PropertyType = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;typeof&lt;/FONT&gt;&lt;FONT size=2&gt;(System.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;BR&gt;    &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;override&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;FONT size=2&gt; GetValue(&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Object&lt;/FONT&gt;&lt;FONT size=2&gt; component)&lt;BR&gt;    {&lt;BR&gt;        &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;return&lt;/FONT&gt;&lt;FONT size=2&gt; ((&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;PartsBO&lt;/FONT&gt;&lt;FONT size=2&gt;)component).lentolerance;&lt;BR&gt;    }&lt;BR&gt;    &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;override&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; SetValue(&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Object&lt;/FONT&gt;&lt;FONT size=2&gt; component, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;FONT size=2&gt; Value)&lt;BR&gt;    {&lt;BR&gt;        ((&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;PartsBO&lt;/FONT&gt;&lt;FONT size=2&gt;)component).lentolerance = (System.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt;)Value;    &lt;FONT color=#ff1111&gt;&amp;lt;----THIS IS THE OFFENDING LINE&lt;/FONT&gt;&lt;BR&gt;    }&lt;BR&gt;    &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;override&lt;/FONT&gt;&lt;FONT size=2&gt; System.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Type&lt;/FONT&gt;&lt;FONT size=2&gt; PropertyType&lt;BR&gt;    {&lt;BR&gt;        &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;get&lt;BR&gt;        &lt;/FONT&gt;&lt;FONT size=2&gt;{&lt;BR&gt;            &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;return&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;._PropertyType;&lt;BR&gt;        }&lt;BR&gt;    }&lt;BR&gt;    &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;override&lt;/FONT&gt;&lt;FONT size=2&gt; System.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Type&lt;/FONT&gt;&lt;FONT size=2&gt; ComponentType&lt;BR&gt;    {&lt;BR&gt;        &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;get&lt;BR&gt;        &lt;/FONT&gt;&lt;FONT size=2&gt;{&lt;BR&gt;            &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;return&lt;/FONT&gt;&lt;FONT size=2&gt; _ComponentType;&lt;BR&gt;        }&lt;BR&gt;    }&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;Since this code is in the designer class, I assume there is a way to handle this via the Object Mapper.  I'm just not seeing it.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;Bill&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Tue, 22 Jan 2008 13:55:01 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Copy Current Record</title><link>http://forum.strataframe.net/Topic13603-6-1.aspx</link><description>Ran into another issue while testing...null values.  These things just get everywhere...like a bad rash!  Even after I have the replace value option set on a specific column, the error thrown is a null value issue.  It is trying to copy a null and it doesn't like it.  Any words of wisdom on this one?</description><pubDate>Tue, 22 Jan 2008 12:34:35 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Copy Current Record</title><link>http://forum.strataframe.net/Topic13603-6-1.aspx</link><description>Is it this?&lt;/P&gt;&lt;P&gt;myBO&lt;FONT size=2&gt;.CurrentDataTable.Columns[myCol.ColumnName]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;The DataRow has a similar definition:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;myDataRow&lt;FONT size=2&gt;.Table.Columns[myCol.ColumnName]&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;</description><pubDate>Tue, 22 Jan 2008 11:00:24 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Copy Current Record</title><link>http://forum.strataframe.net/Topic13603-6-1.aspx</link><description>Excellent Paul!  Thanks!!&lt;/P&gt;&lt;P&gt;I am wondering, though, why no property explicitly exists in the business object called "FieldName".  Over time I have forced myself not to use shortcuts like this one (e.g. myBO[myCol.ColumnName]).  I would rather do something like myBO.FieldName[myCol.ColumnName].  The code is a tad more readable.  The default property can change (doubt it will, but I have no control over that) so this would eliminate a lot of code fixups later down the road.&lt;/P&gt;&lt;P&gt;Maybe it is there and I just am not referencing it correctly.  Still learning.  ;)&lt;/P&gt;&lt;P&gt;Bill</description><pubDate>Tue, 22 Jan 2008 10:55:52 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Copy Current Record</title><link>http://forum.strataframe.net/Topic13603-6-1.aspx</link><description>Bill you can just drop the .items. &lt;BR&gt;&lt;/P&gt;&lt;P&gt;For example MyBO("ColumnName") = proposed value or you could do mybo.currentdatatable.items("columnname") = proposed value. the first example is probably better has it calls through SF logic thus events are raised etc.&lt;/P&gt;&lt;P&gt;To find the primary key you can check the primary key field property .&lt;/P&gt;&lt;P&gt;if mCol.ColumnName = mybo.primarykeyfield then&lt;/P&gt;&lt;P&gt; it is the primary key&lt;/P&gt;&lt;P&gt;endif&lt;/P&gt;&lt;P&gt;However if you are using compound pk's then there is a primarykeyfields collection you would have to loop through the collection to check if it was a PK.&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Paul&lt;BR&gt;</description><pubDate>Tue, 22 Jan 2008 08:43:43 GMT</pubDate><dc:creator>Paul Chase</dc:creator></item><item><title>RE: Copy Current Record</title><link>http://forum.strataframe.net/Topic13603-6-1.aspx</link><description>There does not appear to be an items collection within the business object.  Here is my code:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;DataRow&lt;/FONT&gt;&lt;FONT size=2&gt; mCurrentPart = partsBO1.CurrentRow;&lt;BR&gt;partsBO1.Add();&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;foreach&lt;/FONT&gt;&lt;FONT size=2&gt; (&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;DataColumn&lt;/FONT&gt;&lt;FONT size=2&gt; mCol &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;in&lt;/FONT&gt;&lt;FONT size=2&gt; partsBO1.CurrentDataTable.Columns)&lt;BR&gt;{&lt;BR&gt;    &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt; (mCol.ColumnName!=&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"partindex"&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;BR&gt;    {&lt;BR&gt;        partsBO1.&lt;FONT color=#ff1111&gt;Items&lt;/FONT&gt;(mCol.ColumnName) = mCurrentPart.&lt;FONT color=#ff1111&gt;Items&lt;/FONT&gt;(mCol.ColumnName);&lt;BR&gt;    }&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;The items (in red) do not exist (at least, not by intellisense; therefore, compiler won't like it either).  I cannot seem to find anything comparable in the BO.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;Also, is there a way to tell if the column is a PK or not?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Oh, I am using Add() rather than NewRow() because I need the user to save the data after he is done updating the record.  The NewRow() adds the appropriate empty row, but leaves the state unchanged.  The Add() method does create a new row, but it also places the item into an editable state.  The beauty there is that all of the bound controls are refreshed, too.&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;Thanks!&lt;BR&gt;Bill&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Mon, 21 Jan 2008 18:41:53 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Copy Current Record</title><link>http://forum.strataframe.net/Topic13603-6-1.aspx</link><description>I did something similar a couple of minutes ago.  I added a BO to the form and named it PartTempBO.  When the user clicks the button, I fill that BO with the FillByPrimaryIndex method from the index of the primary BO.  Then, I run the Add() method on the primary BO.  I manually set the properties of the new record to the properties of the temp record (except the differentiating field...partnum); however, after reading your reply, I think I will try the walk the collection route.  That would be easier...especially, since I know we will be modifying that data table's structure over the next several weeks.&lt;/P&gt;&lt;P&gt;Thanks a lot for your help!&lt;BR&gt;Bill</description><pubDate>Mon, 21 Jan 2008 17:17:39 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Copy Current Record</title><link>http://forum.strataframe.net/Topic13603-6-1.aspx</link><description>Yeah, you can just create a shared (sorry static since you are C# ;)) method that copies the data out of the row.  This is probably something we could add to the Tools.Common class, but just haven't as of yet.&lt;/P&gt;&lt;P&gt;[codesnippet]'-- Save off the current row&lt;BR&gt;Dim copyRow As DataRow = MyBo.CurrentRow&lt;BR&gt;MyBo.NewRow()&lt;/P&gt;&lt;P&gt;'-- Now update each of the columns within the new row.  You may want to test&lt;BR&gt;'    on certain column names to be excluded, such as PK fields.&lt;BR&gt;For each col as DataColumn In MyBo.CurrentDataTable.Columns&lt;BR&gt;    MyBo.Items(col.ColumnName) = copyRow.Item(col.ColumnName)        &lt;BR&gt;Next[/codesnippet]&lt;/P&gt;&lt;P&gt;I didn't run this to make sure that the copyRow didn't move (I just typed it in here) but it should be close enough to get you going.</description><pubDate>Mon, 21 Jan 2008 16:59:09 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>Copy Current Record</title><link>http://forum.strataframe.net/Topic13603-6-1.aspx</link><description>I searched the forum in vain for an answer to this.  How do I copy the current record of  BO to a new record in the same BO, reset a couple of values, navigate to that new record and allow the user to alter any necessary fields before saving?  This seems very simple.&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR&gt;Bill</description><pubDate>Mon, 21 Jan 2008 16:47:18 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item></channel></rss>