Xrm.Navigation.openForm不尊重 [英] Xrm.Navigation.openForm not honouring formid

查看:276
本文介绍了Xrm.Navigation.openForm不尊重的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试遵循此处,说明了如何使用 Xrm.Navigation.openForm 方法打开新实体的CRM表单。

I'm trying to follow the examples found here that explain how to use Xrm.Navigation.openForm method to open a CRM form for a new entity.

我的目标实体具有多种形式,我正尝试在 entityFormOptions 对象中指定表单ID在上面的链接中。我已在此处复制相关文本(相关行以粗体显示):

My target entity has multiple forms and I'm trying to specify the form ID in the entityFormOptions object as described in the link above. I've copied the relevant text here (with the relevant line in bold):


entityFormOptions



用于打开表单的实体表单选项。
对象包含以下属性:

entityFormOptions

Entity form options for opening the form. The object contains the following attributes:


  • cmdbar :(可选)布尔值。指示是否显示命令栏。如果未指定此参数,则默认情况下显示命令栏。

  • createFromEntity :(可选)查找。指定一条记录,该记录将基于映射的属性值提供默认值。查找对象具有以下字符串属性:EntityType,ID和名称(可选)。

  • entityId :(可选)字符串。要显示其表单的实体记录的ID。

  • entityName :(可选)字符串。要为其显示表单的实体的逻辑名称。

  • formId :(可选)字符串。要显示的表单实例的ID

  • 高度:(可选)数字。表单窗口的高度,以像素为单位。

  • navBar :(可选)字符串。控制是否显示导航栏,以及是否使用站点地图中定义的
    区域和子区域进行应用程序导航。有效值为: on,
    off或 entity。

  • cmdbar: (Optional) Boolean. Indicates whether to display the command bar. If you do not specify this parameter, the command bar is displayed by default.
  • createFromEntity: (Optional) Lookup. Designates a record that will provide default values based on mapped attribute values. The lookup object has the following String properties: entityType, id, and name (optional).
  • entityId: (Optional) String. ID of the entity record to display the form for.
  • entityName: (Optional) String. Logical name of the entity to display the form for.
  • formId: (Optional) String. ID of the form instance to be displayed.
  • height: (Optional) Number. Height of the form window to be displayed in pixels.
  • navBar: (Optional) String. Controls whether the navigation bar is displayed and whether application navigation is available using the areas and subareas defined in the sitemap. Valid values are: "on", "off", or "entity".

但是这似乎对我不起作用。
我的表格ID为 375DE297-C0AF-4711-A811-5F1663FAE5DA

However this doesn't seem to work for me. The ID of my form is 375DE297-C0AF-4711-A811-5F1663FAE5DA

这是我的代码:

var entityFormOptions = {};
entityFormOptions["entityName"] = "contact";
entityFormOptions["formId"] = "375DE297-C0AF-4711-A811-5F1663FAE5DA";
Xrm.Navigation.openForm(entityFormOptions);

新实体表单打开;

我以系统管理员身份运行,并且我已经确认可以访问指定实体的所有表单因此,我认为这不是表单安全问题。

I am running as a System Administrator and I have confirmed that I have access to all the forms for the specified entity so I don't think it is a form-security issue.

有人尝试过这种在Dynamics 365中打开表单的方法吗?

Has anyone tried this method of opening forms in Dynamics 365?

推荐答案

这似乎是文档中的错误或Dynamics中的错误。

That's looks like mistake in docs or bug in Dynamics.

先前的实现(v8及更高版本)参数对象中的 formid https:// msdn.microsoft.com/zh-cn/library/jj602956.aspx#openEntityForm

Previous implementation (v8 and before) took formid in parameters object: https://msdn.microsoft.com/en-us/library/jj602956.aspx#openEntityForm

尽管当前文档指出必须在entityFormOptions中设置formId,但它不是真正兑现了。但是,当您将其置于良好的旧formParameters上时,我们感到很荣幸。

Although current documentation states that formId must be set in entityFormOptions it isn't actually honoured. But it is honoured when you put it to good old formParameters.

这样就可以了:

var entityFormOptions = {};
entityFormOptions["entityName"] = "contact";
var formParameters = {};
formParameters ["formid"] = "375DE297-C0AF-4711-A811-5F1663FAE5DA";
Xrm.Navigation.openForm(entityFormOptions, formParameters);

P.S。请注意,小写 formid

P.S. Note that lowercase "formid".

这篇关于Xrm.Navigation.openForm不尊重的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆