﻿<?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?)  » Exclude some fields from record copy</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sat, 30 May 2026 06:48:42 GMT</lastBuildDate><ttl>20</ttl><item><title>Exclude some fields from record copy</title><link>http://forum.strataframe.net/FindPost22509.aspx</link><description>Hi Trent&lt;P&gt;I use a routine from this post &lt;A href="http://forum.strataframe.net/Topic13603-6-3.aspx"&gt;http://forum.strataframe.net/Topic13603-6-3.aspx&lt;/A&gt;&amp;nbsp;for duplicate a record. In one windows I have a Maintenance form, and after duplicate I manually remove text form some fields that must have differente information.&lt;/P&gt;&lt;P&gt;My problem is that in another Window I use a ListView, when users select a row can copy to a new record and then the edit form opens, but I need to exclude some fields than must contain new information&lt;/P&gt;&lt;P&gt;How do I exclude some fields from being copied?&lt;/P&gt;&lt;P&gt;&lt;DIV style="BORDER-BOTTOM: #000080 1px dashed; BORDER-LEFT: #000080 1px dashed; PADDING-BOTTOM: 10px; BACKGROUND-COLOR: #ffffff; PADDING-LEFT: 10px; PADDING-RIGHT: 10px; FONT-FAMILY: Courier New, Verdana; COLOR: #000080; MARGIN-LEFT: 20px; FONT-SIZE: 8pt; BORDER-TOP: #000080 1px dashed; MARGIN-RIGHT: 20px; BORDER-RIGHT: #000080 1px dashed; PADDING-TOP: 10px"&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; col.ColumnName = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.PublicacionesBO1.PrimaryKeyField &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&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=#0000ff size=2&gt;Continue&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;For&lt;/P&gt;&lt;/FONT&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=#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;If&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;If col.ColumnName = Me.PublicacionesBO1.Ofertas Then&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;&amp;nbsp;Continue For&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;End If&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#008000&gt;... some other fields here&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;.PublicacionesBO1.CurrentRow(col) = copyRow(col)&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;Do you have some ideas?&lt;/P&gt;&lt;P&gt;Regards</description><pubDate>Mon, 30 Mar 2009 09:22:29 GMT</pubDate><dc:creator>Juan Carlos Pazos</dc:creator></item><item><title>RE: Exclude some fields from record copy</title><link>http://forum.strataframe.net/FindPost22538.aspx</link><description>Trent&lt;br&gt;
&lt;br&gt;
If you take a look to the code I enter or to the original post, the copy function it's already working, the problem is that - need to exclude some fields.&lt;br&gt;
&lt;br&gt;
In the code you suggest I do not see what's the difference. In your code I need one line with the name of the column for each data field?&lt;br&gt;
&lt;br&gt;
Regards</description><pubDate>Mon, 30 Mar 2009 09:22:29 GMT</pubDate><dc:creator>Juan Carlos Pazos</dc:creator></item><item><title>RE: Exclude some fields from record copy</title><link>http://forum.strataframe.net/FindPost22524.aspx</link><description>Within any application you should have a shared ot static class that you place common methods.&amp;nbsp; THis would be a good place to do that.&amp;nbsp; So you would want to create a method that accepts two BOs and a list of columns to include/exclude.&lt;/P&gt;&lt;P&gt;[codesnippet]Public Sub CopySomeFields(ByVal sourceBo As BusinessLayer, ByVal destBo As BusinessLayer, ByVal columnsToInclude As String())&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each bo As BusinessLayer in sourceBo.GetEnumerable()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Create the new row within the destBO&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; destBo.NewRow()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Cycle through the columns&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each colName As String in columnsToInclude&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; destRow.CurrentRow.Items(colName) = bo.CurrentRow.Items(colName)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;/P&gt;&lt;P&gt;End Sub[/codesnippet]&lt;/P&gt;&lt;P&gt;This is just a quick sample and this code could be optimized.&amp;nbsp; But this should get you going down the right path and may spark some ideas.</description><pubDate>Mon, 30 Mar 2009 08:20:35 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>