我正在与从视图创建的 DataEntity 斗争。该场景是 PowerBI 将通过 d365 实例中的“/data”url 使用实体。当请求实体并且应该生成 json 时,什么也没有发生。当我从浏览器打开 WebDeveloperTools 并请求该实体的 url 时,出现以下错误:
{
"error":{
"code":"","message":"An error has occurred.","innererror":{
"message":"The given model does not contain the type 'Microsoft.Dynamics.Ax.Xpp.EdtArray`1[System.Decimal]'.",
"type":"System.InvalidOperationException",
"stacktrace":" at System.Web.OData.Formatter.Serialization.ODataSerializerContext.GetEdmType(Object instance, Type type)\r\n
at System.Web.OData.Formatter.Serialization.ODataEntityTypeSerializer.CreateStructuralProperty(IEdmStructuralProperty structuralProperty, EntityInstanceContext entityInstanceContext)\r\n
at System.Web.OData.Formatter.Serialization.ODataEntityTypeSerializer.CreateStructuralPropertyBag(IEnumerable`1 structuralProperties, EntityInstanceContext entityInstanceContext)\r\n
at System.Web.OData.Formatter.Serialization.ODataEntityTypeSerializer.CreateEntry(SelectExpandNode selectExpandNode, EntityInstanceContext entityInstanceContext)\r\n
at System.Web.OData.Formatter.Serialization.ODataEntityTypeSerializer.WriteEntry(Object graph, ODataWriter writer, ODataSerializerContext writeContext)\r\n
at System.Web.OData.Formatter.Serialization.ODataFeedSerializer.WriteFeed(IEnumerable enumerable, IEdmTypeReference feedType, ODataWriter writer, ODataSerializerContext writeContext)\r\n
at System.Web.OData.Formatter.ODataMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, HttpContent content, HttpContentHeaders contentHeaders)\r\n
at System.Web.OData.Formatter.ODataMediaTypeFormatter.WriteToStreamAsync(Type type, Object value, Stream writeStream, HttpContent content, TransportContext transportContext, CancellationToken cancellationToken)\r\n
--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Tracing.ITraceWriterExtensions.<TraceBeginEndAsyncCore>d__24.MoveNext()\r\n
--- End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Owin.HttpMessageHandlerAdapter.<BufferResponseContentAsync>d__13.MoveNext()"
}
}
}
这是什么意思,更重要的是我怎样才能避免这种情况?
数据源是一个名为“TSTimesheetSummaryLine”的视图。我复制了另一个实体,从中删除了所有内容,将视图作为数据源删除,然后将所有字段从数据源拖放到实体的字段
我注意到视图确实包含一个实数数组(小时)