gpt4 book ai didi

javascript - Xrm.Navigation.openForm 不尊重 formid

转载 作者:行者123 更新时间:2023-11-29 20:55:57 25 4
gpt4 key购买 nike

我正在尝试遵循找到的示例 here解释了如何使用 Xrm.Navigation.openForm 方法为新实体打开 CRM 表单。

我的目标实体有多个表单,我正尝试在 entityFormOptions 对象中指定表单 ID,如上面的链接所述。我在这里复制了相关文本(相关行以粗体显示):

entityFormOptions

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

  • 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

这是我的代码:

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

新的实体窗体打开;但是它使用默认形式,而不是指定的形式。

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

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

最佳答案

这看起来像是文档中的错误或 Dynamics 中的错误。

以前的实现(v8 及之前)在参数对象中使用 formid:https://msdn.microsoft.com/en-us/library/jj602956.aspx#openEntityForm

虽然当前文档声明 formId 必须在 entityFormOptions 中设置,但实际上并没有兑现。但是,当您将它设置为良好的旧形式参数时,它会很荣幸。

这样就可以了:

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

附言请注意小写的 "formid"

关于javascript - Xrm.Navigation.openForm 不尊重 formid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49359342/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com