【问题标题】:Getting error there is no entity map defined for the given entities出现错误,没有为给定实体定义实体映射
【发布时间】:2019-10-27 19:45:22
【问题描述】:

尝试打开父实体“帐户”的“约会”快速创建表单时出现错误。下面是我正在尝试实现的代码。不知道我哪里做错了:

let parent = {};
parent['entityType'] = "account";
parent['id'] = "xxxx";
parent['name'] = "xxx";

var entityFormOptions = {};
entityFormOptions["entityName"] = "appointment";
entityFormOptions["createFromEntity"] = parent;
entityFormOptions["useQuickCreateForm"] = true;
entityFormOptions["openInNewWindow"] = false;

// Open the form.
Xrm.Navigation.openForm(entityFormOptions, params).then(
    function (success) {
            console.log(success);
        },
    function (error) {
                console.log(error);
        });

这是我得到的响应错误:

{"error":{"code":"0x80040e01","message":"没有实体图 为给定实体定义","innererror":{"message":"没有 为给定定义的实体映射 实体","类型":"System.ServiceModel.FaultException1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]","stacktrace":" at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Execute(OrganizationRequest request, InvocationContext invocationContext, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, ExecutionContext executionContext, Dictionary2 可选参数)\r\n 在 Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.Execute(组织请求 请求,ExecutionContext executionContext)\r\n at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.ExecuteOperation(CrmODataExecutionContext 上下文,EdmOperation edmOperation,Dictionary2 parameters, Dictionary2 boundParameters)\r\n at Microsoft.Crm.Extensibility.OData.ActionController.ProcessOperationRequest(字符串 operationName, Dictionary2 operationParameters, EntityReference entityReference, String boundEntityName, String boundEntityType)\r\n
at Microsoft.Crm.Extensibility.OData.ActionController.<>c__DisplayClass12_0.<GetUnboundFunction>b__0()\r\n at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func
1 func, IEnumerable1 additionalCustomProperties)\r\n at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func1 函数)\r\n at lambda_method(闭包,对象,对象[])\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.c__DisplayClass10.b__9(对象 实例,Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext,IDictionary`2 参数,CancellationToken cancelToken)\r\n--- 来自先前位置的堆栈跟踪结束 抛出异常的地方 ---\r\n 在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务 任务)\r\n 在 System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext()\r\n--- 从先前抛出异常的位置结束堆栈跟踪 ---\r\n 在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务 任务)\r\n 在 System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext()\r\n--- 从先前抛出异常的位置结束堆栈跟踪 ---\r\n 在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务 任务)\r\n 在 System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()"}}}

【问题讨论】:

  • 错误是什么?
  • 在帖子中添加了错误

标签: dynamics-crm dynamics-crm-2013


【解决方案1】:

我认为这不是有效的查找值。试试这样:

var lookup = new Array();
lookup[0] = new Object();
lookup[0].id = "xxx";
lookup[0].entityType = "account";
lookup[0].name = "xxx";
//set lookup
entityFormOptions["createFromEntity"] = lookup;

【讨论】:

    【解决方案2】:

    谢谢大家,我的问题已经解决了。我的代码似乎没有父子关系,因此出现错误。

    【讨论】:

      猜你喜欢
      • 2018-06-08
      • 1970-01-01
      • 2019-07-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-28
      • 2016-06-29
      相关资源
      最近更新 更多