web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Excel Add-In error: sequence contains more than one matching element

(0) ShareShare
ReportReport
Posted on by

Hi, we have added some custom fields to EcoResProduct - they are all simple types and AX 2012 R3 is totally fine with them except when trying to access EcoResProduct via Excel Add-in. As soon as I add EcoResProduct table from the list in the Dynamics AX Office Add-in Add Tables wizard and hit OK, I get Microsoft Dynamics AX Office Addin error:

"

An error occurred. The data in the workbook and the behavior of any add-ins may not be correct. Consider contacting your system administrator about this problem.

Sequence contains more than one matching element

"

Any idea what could be wrong? Any clues would be much appreciated.

*This post is locked for comments

I have the same question (0)
  • Syed Shabab Mujtaba Profile Picture
    278 on at
    RE: Excel Add-In error: sequence contains more than one matching element

    Hi,

    Have your tried the same with some other table whether you are getting same error or it is working.

    else you should refresh WCF once.

  • psined Profile Picture
    on at
    RE: Excel Add-In error: sequence contains more than one matching element

    Thank you for response, it works with other tables. How do you mean I should refresh WCF?

  • Syed Shabab Mujtaba Profile Picture
    278 on at
    RE: Excel Add-In error: sequence contains more than one matching element

    Hi,

    There should not much problem even if you added your customized fields in the tables. may be if you can refresh WCF Microsoft dynamics AX configuration utility-> click on connection tab. I hope you will do this stuff on DEV environment.

  • psined Profile Picture
    on at
    RE: Excel Add-In error: sequence contains more than one matching element

    Hi, thanks again. All of this is taking place in DEV and TEST and several other non-production environments we have around here. None of the other tables we have added custom fields to present any issues to Excel add-in. It's only EcoResProduct so far.

    From the error it feels like when the table (and related tables) metadata is being retrieved by Excel add-in some properties appear to have duplicate values. But we couldn't find any - all columns and keys appear to have unique names.

    I'm not sure I know how to refresh WCF (I presume you refer to Windows Communication Foundation, which is part of .Net Framework?) - do you mean I should re-install something? Could you elaborate please?

    I wish there was an easy (and well documented) method to debug the document framework. We have activated all necessary settings in AX active configuration both on the server and on the client according to MS guidelines on how to debug the Business Connector. We have also put breakpoints all over the place around ***Service/Axd***/Ax*** class methods. Sadly the AX debugger will not break during Excel add-in calls. So we are not sure what to do. Unfortunately for us we do not understand very well which AX Framework classes exactly get called by Excel add-in to begin with, so chances are we are not looking in the right spot. If anybody has managed to successfully debug into Excel add-in calls, could you please share the steps?

  • psined Profile Picture
    on at
    RE: Excel Add-In error: sequence contains more than one matching element

    Hi I have followed your advice on refreshing WCF configuration, however I'm still having the same error when opening EcoResProduct via Excel add-in. Any other ideas? Anyone?

  • Syed Shabab Mujtaba Profile Picture
    278 on at
    RE: Excel Add-In error: sequence contains more than one matching element

    Hi,

    sorry for the late reply. If anyone from the community share's the info will be great.

  • Fredrik Sætre Profile Picture
    12,644 on at
    RE: Excel Add-In error: sequence contains more than one matching element

    Hi there,

    Could it have something to do with your indexes? Could you try creating a new index to ensure unique records. Try synchronizing and maybe reindex?

    And also:

    ax2012exceldataimport.blogspot.no/.../dynamics-ax-2012-excel-add-in.html

    Thou I don't think that is the main issue here.

  • psined Profile Picture
    on at
    RE: Excel Add-In error: sequence contains more than one matching element

    Hi, thanks for reply. Trust me, checked out the indexes already and no dice.. EcoResProduct has two indexes - one (defined as) unique on DisplayProductNumber and one non-unique (unique by nature) on InstanceRelationType and RecId. I have verified just in case, and sure enough - no dups:

    SELECT [DISPLAYPRODUCTNUMBER]

    FROM [DynamicsAX].[dbo].[ECORESPRODUCT]

    group by [DISPLAYPRODUCTNUMBER] having count(1)>1

    SELECT InstanceRelationType,RecId

    FROM [DynamicsAX].[dbo].[ECORESPRODUCT]

    group by InstanceRelationType,RecId having count(1)>1

    I'm kind of out of ideas what else could be wrong... All "custom" fields have unique names. The only thing that comes in mind that it could have something to do with the fact that this table supports inheritance and serves as a base for some other tables, such as EcoResProductMaster (which actually is another table I have found to be reporting the same error).

    Any other ideas?

  • Verified answer
    psined Profile Picture
    on at
    RE: Excel Add-In error: sequence contains more than one matching element

    To anyone interested, I was able to fix the error by recreating a custom relationship which wasn't setup right - it had involved the same custom field from EcoResProduct linked twice to two different fields on the related table end. After recreating the strenuous relation from scratch the issue was resolved.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
Community Member Profile Picture

Community Member 2

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans