I want to fetch logical name of attributes are in main form of account entity from systemform entity using javascript.And also Want to save that names in array or list.
Please Suggest me proper query and how to get name of each attribute from response.
Code:
var serverUrl; serverUrl = location.protocol + "//" + location.host; function getformfields() { debugger; var oDataUri = "systemforms?$select=formxml&$filter=name eq 'account'"; var data = getODataRecords(oDataUri); if(data!=null&&data!="") { //how to get field name from response } } function getODataRecords(ODataUrl) { debugger; var data; var Query = ODataUrl; var req = new XMLHttpRequest(); req.open("GET", serverUrl + "/api/data/v8.0/" + Query, false); req.setRequestHeader("Accept", "application/json"); req.setRequestHeader("Content-Type", "application/json; charset=utf-8"); req.setRequestHeader("OData-MaxVersion", "4.0"); req.setRequestHeader("OData-Version", "4.0"); req.setRequestHeader("Prefer", "odata.include-annotations=OData.Community.Display.V1.FormattedValue"); req.onreadystatechange = function () { if (this.readyState == 4 /* complete */) { req.onreadystatechange = null; if (this.status == 200) { data = JSON.parse(this.response); } else { var error = JSON.parse(this.response).error; alert(error.message); } } }; req.send(); return data; }