Skip to main content

Notifications

Microsoft Dynamics GP forum
Answered

eConnect.eConnectException: Sequence contains no elements

Posted on by 10

I have an application that syncs a document library on Sharepoint with KL using eConnect. Basically on a person approving a document, a work flow gets kicked of, and the workflow sends the invoice to GP2013. Seemingly randomly we are getting this error[1] when eConnectMethods.CreateTransactionEntity is called. After that when eConnectMethods.Dispose is called another error is thrown[2].

The frustrating thing about this error is if we rerun the workflow, it works no problems. Same code and same xml and the error seems to not follow any patterns.

[1]

CreateTransactionEntity eConnectException: Microsoft.Dynamics.GP.eConnect.eConnectException: Sequence contains no elements 
   at Microsoft.Dynamics.GP.eConnect.ServiceProxy.CreateTransactionEntity(String connectionString, String xml) 
   at Microsoft.Dynamics.GP.eConnect.eConnectMethods.EntityImportImplementation(String connectionString, String sXML, Boolean isTransaction) 
   at Microsoft.Dynamics.GP.eConnect.eConnectMethods.CreateTransactionEntity(String connec tionString, String sXML) 
   at Mysolution.namespace.SendToGreatPlains.submit(eConnectType eConnType, String dbConn, String& errorMessage) 

[2]

System.ServiceModel.CommunicationObjectFaultedException: The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication  because it is in the Faulted state. 
   at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout) 
   at System.ServiceModel.Channels.ServiceChannelFactory.OnClose(TimeSpan timeout) 
   at System.ServiceModel.Channels.ServiceChannelFactory.TypedServiceChannelFactory`1.OnClose(TimeSpan timeout) 
   at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout) 
   at System.ServiceModel.ChannelFactory.OnClose(TimeSpan timeout) 
   at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout) 
   at Microsoft.Dynamics.GP.eConnect.ServiceProxy.Dispose() 
   at Microsoft.Dynamics.GP.eConnect.eConnectMethods.Dispose() 
   at Mysolution.namespace.SendToGreatPlains.submit(eConnectTyp e eConnType, String dbConn, String& errorMessage) 

 

I've tried this article's suggestion:

http://support.microsoft.com/kb/2539263

I've also tried many changes in the code.

These are on on good hardware and the network between them is solid.

Any suggestions? Do you need more information?

  • Verified answer
    mike024 Profile Picture
    mike024 10 on at
    RE: eConnect.eConnectException: Sequence contains no elements

    Sequence Contains no elements means that you are missing required fields.

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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,522 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,441 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Product updates

Dynamics 365 release plans