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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

Submiting case on Microsoft Portal causes a Sequence contains no elements exception

(0) ShareShare
ReportReport
Posted on by

Hello experts,

I created a customer self-service trial portal to test out Microsoft Portal technology,

and there is an error message when I try to submit a case on Portal to Dataverse.

I tried every possible solution, case creation just works fine in Dynamics 365, only broken on Portal.

Here is the error I got:

Server Error in '/' Application.


Sequence contains no elements

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Sequence contains no elements

Exception stack trace:

[InvalidOperationException: Sequence contains no elements]
   Microsoft.Xrm.Sdk.Linq.QueryProvider.ThrowException(Exception exception) +12
   Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute(QueryExpression qe, Boolean throwIfSequenceIsEmpty, Boolean throwIfSequenceNotSingle, Projection projection, NavigationSource source, List`1 linkLookups, String& pagingCookie, Boolean& moreRecords) +870
   Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute(QueryExpression qe, Boolean throwIfSequenceIsEmpty, Boolean throwIfSequenceNotSingle, Projection projection, NavigationSource source, List`1 linkLookups) +121
   Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute(Expression expression) +277
   Microsoft.Xrm.Sdk.Linq.QueryProvider.System.Linq.IQueryProvider.Execute(Expression expression) +72
   Adxstudio.Xrm.Web.UI.CrmEntityFormView.SharePointDocumentsControlTemplate.BuildSharePointGrid(Object id) in S:\Framework\Adxstudio.Xrm\Web\UI\CrmEntityFormView\SharePointDocumentsControlTemplate.cs:267
   Adxstudio.Xrm.Web.UI.CrmEntityFormView.SharePointDocumentsControlTemplate.InstantiateControlIn(HtmlControl container) in S:\Framework\Adxstudio.Xrm\Web\UI\CrmEntityFormView\SharePointDocumentsControlTemplate.cs:86
   Adxstudio.Xrm.Web.UI.CrmEntityFormView.TableLayoutRowTemplate.InstantiateLayoutIn(Control container, IEnumerable`1 cellTemplates) in S:\Framework\Adxstudio.Xrm\Web\UI\CrmEntityFormView\TableLayoutRowTemplate.cs:65
   Adxstudio.Xrm.Web.UI.CrmEntityFormView.TableLayoutRowTemplate.InstantiateIn(Control container) in S:\Framework\Adxstudio.Xrm\Web\UI\CrmEntityFormView\TableLayoutRowTemplate.cs:53
   Adxstudio.Xrm.Web.UI.CrmEntityFormView.TableLayoutSectionTemplate.InstantiateIn(Control container) in S:\Framework\Adxstudio.Xrm\Web\UI\CrmEntityFormView\TableLayoutSectionTemplate.cs:141
   Adxstudio.Xrm.Web.UI.CrmEntityFormView.TabTemplate.InstantiateIn(Control container) in S:\Framework\Adxstudio.Xrm\Web\UI\CrmEntityFormView\TabTemplate.cs:122
   Adxstudio.Xrm.Web.UI.CrmEntityFormView.CompositeTemplate.InstantiateIn(Control container) in S:\Framework\Adxstudio.Xrm\Web\UI\CrmEntityFormView\CompositeTemplate.cs:19
   Adxstudio.Xrm.Web.UI.WebControls.CrmEntityFormView.CreateChildControls() in S:\Framework\Adxstudio.Xrm\Web\UI\WebControls\CrmEntityFormView.cs:842
   System.Web.UI.Control.EnsureChildControls() +107
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +47
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +330
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1688

I I enabled diagnostic logging, but when I reproduce this problem, the same exception appears in blob but nothing really useful.

Here I attach the relevant diagnostic message:

2021-06-25T12:30:13,Error,site-***************36,"RequestData:, RequestPath:/support/create-case/, RequestExtension:, SessionId:3sf4ayljj0ezpv5swdow1lf0, UserId:*************, CorrelationId:3d844ab0-99e7-4b70-90f6-35ef853ab482, Elapsed:5427.5293, RequestMethod:GET, RequestContentType:, RequestAccept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8, RequestCacheControl:, UserAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0, HandlerName:ASP.pages_webtemplate_aspx, HandlerExecuted:False, VaryByCustom:user;website;language, MemberName:OnLoad, SourceFilePath:S:\Framework\Adxstudio.Xrm\Web\UI\WebControls\LiquidServerControl.cs, SourceLineNumber:305, ExceptionMessage:Sequence contains no elements
System.InvalidOperationException
at Microsoft.Xrm.Sdk.Linq.QueryProvider.ThrowException(Exception exception)
at Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute(QueryExpression qe, Boolean throwIfSequenceIsEmpty, Boolean throwIfSequenceNotSingle, Projection projection, NavigationSource source, List`1 linkLookups, String& pagingCookie, Boolean& moreRecords)
at Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute[TElement](QueryExpression qe, Boolean throwIfSequenceIsEmpty, Boolean throwIfSequenceNotSingle, Projection projection, NavigationSource source, List`1 linkLookups)
at Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute[TElement](Expression expression)
at Microsoft.Xrm.Sdk.Linq.QueryProvider.System.Linq.IQueryProvider.Execute[TResult](Expression expression)
at Adxstudio.Xrm.Web.UI.CrmEntityFormView.SharePointDocumentsControlTemplate.BuildSharePointGrid(Object id) in S:\Framework\Adxstudio.Xrm\Web\UI\CrmEntityFormView\SharePointDocumentsControlTemplate.cs:line 267
at Adxstudio.Xrm.Web.UI.CrmEntityFormView.SharePointDocumentsControlTemplate.<>c__DisplayClass17_0.<InstantiateControlIn>b__1(Object obj) in S:\Framework\Adxstudio.Xrm\Web\UI\CrmEntityFormView\SharePointDocumentsControlTemplate.cs:line 79
at Adxstudio.Xrm.Web.UI.WebControls.CrmEntityFormView.PerformDataBinding(IEnumerable data) in S:\Framework\Adxstudio.Xrm\Web\UI\WebControls\CrmEntityFormView.cs:line 1350
at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data)
at System.Web.UI.Control.DataBindChildren()
at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
at System.Web.UI.Control.DataBindChildren()
at System.Web.UI.Control.DataBindChildren()
at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
at System.Web.UI.Control.DataBindChildren()
at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
at System.Web.UI.Control.DataBindChildren()
at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
at Adxstudio.Xrm.Web.UI.WebControls.LiquidServerControl.OnLoad(EventArgs args) in S:\Framework\Adxstudio.Xrm\Web\UI\WebControls\LiquidServerControl.cs:line 299

Microsoft.Xrm.Sdk

, EventData:, Category:Application, ErrorCategory:ApplicationError",80018897-0000-ef00-b63f-84710c7967bb

Someone had seen this error before?

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi! Have you found the problem? We're dealing with the exact same error here.

  • Suggested answer
    Eduard Capanu Profile Picture
    5 on at

    Hi,

    I had the same issue and in my case the user portal I used to perform case creation had a Parent Contact set with a Contact and not an Account.

    Seems stupid, but replacing the parent contact with an Account worked for me.

    Have a nice day.

    Eduard.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
11manish Profile Picture

11manish 34

#2
Mallesh Deshapaga Profile Picture

Mallesh Deshapaga 32

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 31 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans