简体   繁体   中英

Populating Entities list into an dropdown on HTML page load using web api

I am trying to load all the available entities in the CRM, using web api and I am able to fetch all the required information.

URL/api/data/v8.0/EntityDefinitions?$select=SchemaName,LogicalName,IsValidForAdvancedFind&$filter=IsValidForAdvancedFind eq true

But, not able to populate the dropdown, on the page load (It is a HTML Page ). Please help me how can I achieve that?

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);
}

您必须更改下拉text分配的语法。

el.text = opt["SchemaName"];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM