Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 CRM 2011 中,使用 JavaScript,如何获取调用实体或表单类型名称?例如,如果我打开一个活动,我想看看我是从帐户表单还是联系表单等中打开这个活动的。我在谷歌上搜索过,但没有找到任何东西。
在这种特殊情况下,您应该检查相关字段 - CRM 会自动填充此字段,该字段应包含您需要的信息。
利用
window.parent.opener.Xrm.Page.data.entity.getEntityName()
这仅在您从调用实体的表单中打开实体时才有效。
如果您从左侧的相关活动部分打开实体,它将不起作用。
基本上,父页面应该加载实体表单才能使用 Xrm.Page.data 对象。