Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

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?

*This post is locked for comments

  • 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,219 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans