如何在Microsoft dynamics crm 365中通过javascript获取查找字段的值 [英] How can I get the value of a lookup field by javascript in Microsoft dynamics crm 365
本文介绍了如何在Microsoft dynamics crm 365中通过javascript获取查找字段的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试获取查找字段值,并通过Microsoft Dynamics CRM中的Javascript将值设置为另一个字段(例如,名称字段)。
我该怎么办?
I am trying to get a lookup field value and set the value into another field ('Name' field for example) by Javascript in Microsoft Dynamics CRM. How can I do it?
推荐答案
我在docs.microsoft上找到了它。要做到这一点,首先您应该了解Dynamics CRM中的文档对象模型,称为Xrm:
I found it on docs.microsoft. To do this, first you should know about Document Object Model in Dynamics CRM which is called "Xrm":
var lookupValue=Xrm.Page.data.entity.attributes.get('new_account').getValue()[0].name;
Xrm.Page.getAttribute("new_name").setValue("Your Account Name is:"+lookupValue);
您可以将它用作函数并在Microsoft动态CRM表单的保存(OnSave)事件上调用它。
You can use it as a function and call it on save (OnSave) event of Microsoft dynamics CRM Form.
这篇关于如何在Microsoft dynamics crm 365中通过javascript获取查找字段的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文