1

How do I get the value of a custom field in Microsoft CRM 4.0 with JavaScript?

Here's what works:

This will get me the ID, for the first element in my resources field,

crmForm.all.resources.DataValue[0].id;

This will get the name,

crmForm.all.resources.DataValue[0].name;

Here's what I was expecting to work, but doesn't:

In my resources, I have created a custom field named new_precohora, and was hoping to be able to get it like this,

crmForm.all.resources.DataValue[0].new_precohora;

But for some reason, that field doens't seem to exist.

I can access if i set JavaScript in my Facility/Equipment form. But I wanted to do it from my resources field, located in the Service Activity form.

Thank you in advance!

4

1 回答 1

1

您无法通过查阅字段访问相关记录的数据。

查找字段只为您提供记录的 ID 和名称,如果您希望从记录中获取更多信息,则需要执行 Web 服务查询。

我建议查看此示例:CrmService.Retrieve Method Using JScript

于 2013-05-12T08:09:46.857 回答