Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Get attribute names are in the main form of particular entity from systemform entity in dynamics CRM

$
0
0

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;

        }




Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>