Friday, December 23, 2011

Trouble shot Edit Item Issue in External List

i create a external List with External Content Type, and this content type is built with Business Model from VS2010.

I successfully launch this external list and try to view each individual item. then the dialog window display the following error message.

"Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator.


Correlation ID:d71cdf7f-1cdc-4dae-b78f-42e2e3c31a8b"


based on the above error message, we only know that web part is failed to display the content. we only perform some investigation to see what is root cause.

as i mentioned in my previous post Trouble shooting sharepoint 2010 with Correlation ID 

since there is a Corrleation ID shown in the error message. then we can use to seek more specific informations about the error followed the post we can get the detail error message from the Log file in the Sharepoint LOGS folder.

"getInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Sequence contains no elements     at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)     at ProductModel.BdcModel1.ProductService.ReadItem(String id)     --- End of inner exception stack trace ---     at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)     at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)     at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAt...    18c78309-5e2d-413c-9e84-3673bebd1053
    ...tr, Binder binder, Object[] parameters, CultureInfo culture)     at Microsoft.SharePoint.BusinessData.SystemSpecific.DotNetAssembly.DotNetAssemblySystemUtility.Execute(Object[] args)    18c78309-5e2d-413c-9e84-3673bebd1053
    Inner exception 2: System.InvalidOperationException: Sequence contains no elements     at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)     at ProductModel.BdcModel1.ProductService.ReadItem(String id)    18c78309-5e2d-413c-9e84-3673bebd1053"

I am easily figure out that there is a bug within the ReadItem Method, the exception is thrown when
to First Method of Enumeralb Object.

No comments:

Post a Comment