Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

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

(0) ShareShare
ReportReport
Posted on by

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;

        }



*This post is locked for comments

  • Yadnyesh Kuvalekar Profile Picture
    Yadnyesh Kuvalekar 4,102 on at
    RE: Get attribute names are in the main form of particular entity from systemform entity in dynamics CRM

    Feel free to mark applicable answers as verified.

  • Suggested answer
    Yadnyesh Kuvalekar Profile Picture
    Yadnyesh Kuvalekar 4,102 on at
    RE: Get attribute names are in the main form of particular entity from systemform entity in dynamics CRM

    It seems like you are using wrong server URL. Please try using below URL:

    https://<servername>.api.crm.dynamics.com/api/data/v8.1/systemforms?$select=formxml&$filter=name eq 'account'

    Also, you should not use location object to get server url. Instead use below method.

    Xrm.Page.context.getClientUrl()

  • Verified answer
    Drew Poggemann Profile Picture
    Drew Poggemann 4 on at
    RE: Get attribute names are in the main form of particular entity from systemform entity in dynamics CRM

    Hi Chhaya,

    You can make this really easy for yourself (I think) and check out the following from Jason Lattimer.  crmrestbuilder.codeplex.com

    Thanks much,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,436 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans