0

我有两个列集对象,如何将它们的列连接到一个列集类型的对象中?

Dim col1 as new ColumnSet()
col1.AddColumn("column1")
col1.AddColumn("column2")

Dim col2 as new ColumnSet()
col2.AddColumn("column3")
col2.AddColumn("column4")

CRM4.0 .NET

4

2 回答 2

0

客户关系管理 4.0

将属性从“col2”添加到“col1”

col1.Attributes.AddRange(col2.Attributes);

客户关系管理 2011

要将列添加col2col1

col1.Columns.AddRange(col2.Columns);

要创建新集合:

allColumns = col1.Columns.Union(col2.Columns);

于 2013-09-17T21:07:57.007 回答
0

C#版本:

ColumnSet column1 = new ColumnSet("name", "description");
ColumnSet column2 = new ColumnSet("name", "createdon");
ColumnSet merged = new ColumnSet((column1.Columns.Union(column2.Columns)).ToArray());

VB.NET 版本:

Dim column1 As New ColumnSet("name", "description")
Dim column2 As New ColumnSet("name", "createdon")
Dim merged As New ColumnSet((column1.Columns.Union(column2.Columns)).ToArray())

Union 将处理重复的字段

于 2013-09-18T14:19:20.167 回答