在CRM 2011 Javascript中设置和获取Notes字段 [英] Set and get Notes field in CRM 2011 Javascript

查看:54
本文介绍了在CRM 2011 Javascript中设置和获取Notes字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将注释字段设置为CRM 2011表单中其他实体中的注释字段值。因此,我需要知道如何使用Javascript获取和设置Notes字段。而且我无法获得该部分内的Notes字段的名称,如下图所示。

I need to set the Notes field to the Notes field value in other entity in CRM 2011 form. So, I need to know how get and set the Notes field using Javascript. And I'm not able to get the name of Notes field inside the section as you can seen in the below image.

推荐答案

好,有两种方法这里需要。

OK there are two approaches required here.

@Philip_Rich指出,现有记录的注释会在失去焦点后立即创建,因此可以查询。您应该能够很容易地找到用于此目的的现有代码(如果没有,请在这里询问)。

@Philip_Rich pointed out that annotations for existing records are created as soon as they lose focus and can therefore be queried. You should be able to find existing code for this quite easily (if not, ask here).

您自己已经承认,对于新的(未保存的)记录,不会保存注释。直到保存父记录为止。目前,尚无支持的方法来访问notes字段中的值,但是,这段令人讨厌的代码应该可以获取您想要的值。请注意,由于不受支持,因此很容易受到以下形式的DOM更改的影响:

You yourself acknowledged that for new (unsaved) records, annotations are not saved until after the parent record is saved. There is no supported way to access the value in the notes field at this point, however this nasty bit of code should get the value you seek. Beware that since it is unsupported, it is vulnerable to DOM changes in the forms:

var myNotesText = document.getElementById("notescontrol").contentWindow.document.getElementById("NotesTable").children[1].children[4].children[0].innerText;

这篇关于在CRM 2011 Javascript中设置和获取Notes字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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