[Solved - scroll down]
Hello
I've created a Portal linked to CRM D365.
I've got a page with an Entity List, which displays fine.
Selecting a record from the Entity List opens the Entity Form on its own page.
That last step works fine, but only when the Entity List view only contains 1 record. As soon as the List contains 2 or more records, I get an error when trying to open a record.
The error says "sequence contains more than one element" and a load of other stuff that I don't fully understand.
I've tried playing with the settings of the Entity List or Form, but I've not found a fix.
Has anyone experienced this and found a solution? I'd be immensely grateful to hear your suggestions.
Like I said, when the List shows only 1 record, it will open just fine; but when the List shows 2 or more, none will open.
Thanks,
Pete.
The error:
Server Error in '/' Application.
Sequence contains more than one element
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 more than one element
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
[InvalidOperationException: Sequence contains more than one element] System.Linq.Enumerable.SingleOrDefault(IEnumerable`1 source) +470 Adxstudio.Xrm.Web.UI.WebControls.EntityForm.GetEntitySourceDefinition(OrganizationServiceContext context, Entity entityform) in S:\Framework\Adxstudio.Xrm\Web\UI\WebControls\EntityForm.cs:1201 Adxstudio.Xrm.Web.UI.WebControls.EntityForm.CreateChildControls() in S:\Framework\Adxstudio.Xrm\Web\UI\WebControls\EntityForm.cs:578 System.Web.UI.Control.EnsureChildControls() +107 System.Web.UI.Control.PreRenderRecursiveInternal() +58 System.Web.UI.Control.PreRenderRecursiveInternal() +227 System.Web.UI.Control.PreRenderRecursiveInternal() +227 System.Web.UI.Control.PreRenderRecursiveInternal() +227 System.Web.UI.Control.PreRenderRecursiveInternal() +227 System.Web.UI.Control.PreRenderRecursiveInternal() +227 System.Web.UI.Control.PreRenderRecursiveInternal() +227 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3671 |