我正在尝试使用 Web API 加载 CRM 中的所有可用实体,并且我能够获取所有必需的信息。
URL/api/data/v8.0/EntityDefinitions?$select=SchemaName,LogicalName,IsValidForAdvancedFind&$filter=IsValidForAdvancedFind eq true
但是,无法在页面加载时填充下拉列表(这是一个 HTML 页面)。请帮助我如何实现这一目标?
var select = document.getElementById("selectEntity");
for (var i = 0; i < results.value.length; i++)
{
var opt = results.value[i];
var el = document.createElement("option");
el.textContent = opt["SchemaName"];
el.value = opt["LogicalName"];
select.appendChild(el);
}
最佳答案
您必须更改下拉文本
赋值的语法。
el.text = opt["SchemaName"];
关于javascript - 使用 Web API 将实体列表填充到 HTML 页面加载的下拉列表中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44977842/