Coming soon: Your brand new Help Center & Community! Get a sneak-peek here

Problem with configuring columns for a custom archive provider in So9.2 R03

Hello,

I am updating a solution for an on premise customer to 9.2 R03. If I try to configure fields for a custom archive provider,

I get an error message:

 

Here is a full stacktrace from the eror:

An unexpected error occurred


An item with the same key has already been added.
Source: mscorlib
Click here to see stacktrace

at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at SuperOffice.CRM.Web.Data.Util.MDOListHelper.FilterAndSortColumnListV2(String provider, String gui, ArchiveConfig config, Func`2 makeGroupItem, IEnumerable`1 items)
at SuperOffice.CRM.Web.Data.Util.MDOListHelper.FilterAndSortColumnList(String provider, String gui, ICollection`1 items)
at SuperOffice.CRM.Web.Data.ArchiveColumnConfigDataHandler.Load(String CarrierId)
at SuperOffice.Data.DataDispatcher.GetDataObject(String index, Boolean addToSync)
at SuperOffice.DCF.Web.UI.DataBoundProperty.getData()
at SuperOffice.CRM.Web.UI.Controls.SoTwinListBox.Initialize(XmlNode config, String id)
at SuperOffice.DCF.Web.UI.Controls.PageBuilder.InitializeControl(XmlNode controlNode)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at SuperOffice.DCF.Web.UI.Controls.PageBuilder.InitializeControlGroup(XmlNode controlGroupNode)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at SuperOffice.DCF.Web.UI.Controls.PageBuilder.InitializeView(XmlNode viewNode, ICard parentCard)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at SuperOffice.DCF.Web.UI.Controls.PageBuilder.InitializeCard(XmlNode cardNode, String panelId, IPanel parentPanel)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at SuperOffice.DCF.Web.UI.Controls.PageBuilder.InitializePanels(XmlNodeList panelNodes)
at SuperOffice.DCF.Web.UI.Controls.PageBuilder.Initialize()
at SuperOffice.DCF.Web.UI.Controls.PageBuilder.OnInit(EventArgs e)


Click here for more information

An item with the same key has already been added.
Source: SuperOffice.DCFWeb
Click here to see stacktrace

 

With a "sale" provider and columns, the rest of .merge files works properly.
I am assuming, this is an issue in my provider class. But it worked in the version 8...

If I comment out all the ArchiveColumnInfo fields in my provider class (or rename it to something but no "_col" prefix), I get no error more (and sure no columns in the configuration window).

If I comment out all but one columns, I get no error too (but still no columns in the config window).

 

This is my dummy class I created to test it without a data connection, here I get the same error:

[ArchiveProvider(m_ProviderName, int.MaxValue / 3)]
public class CustomArchiveTest : IArchiveProvider
{
private const string m_ProviderName = "CustomArchiveTest";
private const string m_EntityName = "Test";

private readonly ColumnHelper m_ColumnHelper = null;
private readonly EntityHelper m_EntityHelper = null;

private int _pageNumber;
private int _pageSize = int.MaxValue - 1;
private int _rowCount = 0;

ArchiveOrderByInfo[] _orderBy;
ArchiveRestrictionInfo[] _restrictions;

private const string ColumnName1 = "Test1";
private const string ColumnName2 = "Test2";

ArchiveColumnInfo _colTest1 = new ArchiveColumnInfo(ColumnName1, "Test1", "Test1", Constants.DisplayTypes.Int, true, true, ColumnHelper.DefaultNumberWidth);
ArchiveColumnInfo _colTest2 = new ArchiveColumnInfo(ColumnName2, "Test2", "Test2", Constants.DisplayTypes.String, true, true, ColumnHelper.DefaultStringWidth);

public CustomArchiveTest()
{
_rowCount = 0;
m_EntityHelper = new EntityHelper();
//m_EntityHelper.AddAvailableEntities(new ArchiveRowTypeInfo(m_EntityName, "Test", "Test", false, true));

m_ColumnHelper = new ColumnHelper(this);
//m_ColumnHelper.AddAvailableColumns(_colTest1, _colTest2);

SetPagingInfo(int.MaxValue, 0);
}


#region IArchiveProviderHasEntities
public List<ArchiveRowTypeInfo> GetAvailableEntities()
{
return m_EntityHelper.GetAvailableEntities();
}

public void SetDesiredEntities(params string[] p_Entities)
{
m_EntityHelper.SetDesiredEntities(p_Entities);
}
#endregion

#region IArchiveProviderHasColumns
public List<ArchiveColumnInfo> GetAvailableColumns()
{
return m_ColumnHelper.AvailableColumns;
}

public void SetDesiredColumns(params string[] p_Columns)
{
m_ColumnHelper.SetDesiredColumns(p_Columns);
}

public void SetOrderBy(params ArchiveOrderByInfo[] p_OrderBys)
{
_orderBy = p_OrderBys;
}
#endregion

#region IArchiveProviderRestrictions
public bool SetRestriction(params ArchiveRestrictionInfo[] i_Restrictions)
{
_restrictions = i_Restrictions;
return true;
}
#endregion

#region IArchiveProviderHasRows
public void Close()
{
}

public ArchiveResultInformation GetResultInformation()
{
ArchiveResultInformation resultInfo = new ArchiveResultInformation();
resultInfo.RowCount = _rowCount;
return resultInfo;
}

public IEnumerable<ArchiveRow> GetRows(String options)
{
return null;
}

public void SetPagingInfo(int i_PageSize, int i_PageNumber)
{
_pageSize = i_PageSize;
_pageNumber = i_PageNumber;
}

public System.Data.IDataReader GetReader(string reader)
{
return null;
}
#endregion

private void GetArchiveRows(List<ArchiveRow> rows)
{

}
}

 

What could be a problem here? It seems to be something wrong with ArchiveColumnInfo columns...
Or maybe I have to update to the latest version 9.2 R07?

Thank you in advance!

 

best regards,
Andrey

 

RE: Problem with configuring columns for a custom archive provider in So9.2 R03

It was a SuperOffice bug:

https://community.superoffice.com/en/product-releases/bugs-wishes/product-issue/?bid=13591&azure=1

Solved in SO 9.2 R09

Af: Andrey Stupak 2. jun 2021