简体   繁体   English

Dynamics crm 365 快速创建表单获取父实体数据

[英]Dynamics crm 365 quick create form get parent entity data

When I click on the "New" link in a form's lookup field, the quick create form opens.当我单击表单查找字段中的“新建”链接时,会打开快速创建表单。 I need to get values of the parent form to prefill some fields of the quick create form.我需要获取父表单的值来预填充快速创建表单的某些字段。 This can't be done with mappings (as seen in some posts in this site), since it must only work in the quick create form.这不能通过映射来完成(如本网站的一些帖子所示),因为它只能在快速创建表单中工作。 How can I do this in javascript?我怎样才能在 javascript 中做到这一点? There is no other way except using localStorage?除了使用localStorage就没有其他办法了吗?

EDIT:编辑:

window.parent.Xrm.Page.getAttribute(attribute name).getValue()

does not work不起作用

You have two choices, to achieve this in js.你有两种选择,在 js 中实现这一点。

  1. Either in main form scripting you can assign in a global variable and access it in Quick create form.在主表单脚本中,您可以分配全局变量并在快速创建表单中访问它。 Depends on the version, you may have to manage formContext instead of Xrm.Page .取决于版本,您可能需要管理formContext而不是Xrm.Page Read more 阅读更多

     var setValsForQuickCreate = function(){ window.top.attributename = Xrm.Page.getAttribute("new_attributename").getValue(); } var setValFromMainForm = function(){ Xrm.Page.getAttribute("new_attributename").setValue(window.top.attributename); }
  2. Otherwise, you can query using the web api on form load, filter it based on parent lookup value mapped and fill the fields.否则,您可以在表单加载时使用 web api 进行查询,根据映射的父查找值对其进行过滤并填充字段。 You can create a separate library/method for registering in QC form only or check only if it is Quick create form and execute it.您可以创建单独的库/方法仅在 QC 表单中注册或仅检查是否为快速创建表单并执行它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 快速创建表单中的Dynamics CRM setFormNotification - Dynamics CRM setFormNotification in Quick Create Form 从弹出式CRM Dynamics 2015中的父表单获取数据 - Get data from parent form in a popup CRM Dynamics 2015 Dynamics CRM 根据父表单/实体在新表单/实体中填充关系数据 - Dynamics CRM fill relationship data in new form/entity according to parent form/entity Dynamics Crm - 在 Javascript 中获取快速创建表单加载时的触发查找字段? - Dynamics Crm - Get Triggering lookup field on quick create form load in Javascript? 如何使用 JavaScript 在 Dynamics 365 CRM 内部部署的表单上填写父查询? - How to use JavaScript to fill parent lookup on form in Dynamics 365 CRM on-premise? 如何在 Dynamics CRM 365 中插入潜在客户数据? - How to insert lead data in Dynamics CRM 365? Dynamics 365 将实体类型传递给表单 - Dynamics 365 Passing Regarding Entity Type to a Form 我想在Dynamics 365 crm中从一种形式重定向到另一种形式 - I want to redirect from one form to another in dynamics 365 crm 在Dynamics 365 CRM上使用Xrm Object将表单设置为只读 - Set form read only using Xrm Object on Dynamics 365 CRM 检索快速查看表单值 - Dynamics CRM JavaScript - Retrieve Quick View Form Value - Dynamics CRM JavaScript
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM