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

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Unanswered

OData Query in Dynamics 365 portal thowing error "Object reference not set to an instance of an object."

(0) ShareShare
ReportReport
Posted on by 5

I am trying to make the OData query in my dev portal, here I m getting the following error. I did all the setting in entity list, not sure why getting this error, I restarted the portal as well but it didn’t work, wanted to check if it is related to MS update or something else.

Apricate your help in advance.

<m:error xmlns:m="schemas.microsoft.com/.../metadata"> <m:code/> <m:message xml:lang="en-US">An error has occurred.</m:message> <m:innererror> <m:message>Object reference not set to an instance of an object.</m:message> <m:type>System.NullReferenceException</m:type> <m:stacktrace> at Adxstudio.Xrm.Web.UI.EntityList.OData.EntityListODataFeedDataAdapter.GetEntityList(IEdmModel model, String entitySetName) in S:\Framework\Adxstudio.Xrm\Web\UI\EntityList\OData\EntityListODataFeedDataAdapter.cs:line 0 at Adxstudio.Xrm.Web.UI.EntityList.OData.EntityListODataFeedDataAdapter.GetPageSize(IEdmModel model, String entitySetName) in S:\Framework\Adxstudio.Xrm\Web\UI\EntityList\OData\EntityListODataFeedDataAdapter.cs:line 183 at Site.Areas.EntityList.Controllers.ODataEntitySetController.Get() in S:\Samples\MasterPortal\Areas\EntityList\Controllers\ODataEntitySetController.cs:line 31 at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()</m:stacktrace> </m:innererror> </m:error>

I have the same question (0)
  • LeoAlt Profile Picture
    16,331 Moderator on at
    RE: OData Query in Dynamics 365 portal thowing error "Object reference not set to an instance of an object."

    Hi partner,

    Please check  the following points.

    1.Check if your URL is correct with the format:  https://<portalurl>/_odata/entity_set_name

    2.Check if your role has the permission to entity.

    I tried to use odata retrieve case records in portal, and it worked well.

    pastedimage1590735121265v1.png

    pastedimage1590735157000v2.png

    Best Regards,

    Leo

  • Girish Soni Profile Picture
    5 on at
    RE: OData Query in Dynamics 365 portal thowing error "Object reference not set to an instance of an object."

    Leo thanks for the update, I tested all the checks and found it correct, It's working for my old entity set, but throwing error for new one. I created for other entities as well but it's throwing error same error.

  • LeoAlt Profile Picture
    16,331 Moderator on at
    RE: OData Query in Dynamics 365 portal thowing error "Object reference not set to an instance of an object."

    Hi partner,

    Please check that if your portal role has the correct entity permission.

    If this issue still exists, please raise a ticket to Microsoft for more professional help.

    Regards,

    Leo

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 49 Super User 2025 Season 2

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 46

#3
CU23101130-0 Profile Picture

CU23101130-0 17

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans