Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Querying metadata and data values

(0) ShareShare
ReportReport
Posted on by 25

Hello there,

I'm starting learning CRM through an intership and currently working on an solution in which I will show some statistics in a Iframe with a webpage.

For such, i'm querying the CRM with the sdk web api (javascript - MSCRM Solution), and for this example i will use generic fields for better understanding:

WebApi.retrieveRecord(VinID, "accounts", "accountnumber,name,telephone1", null,
function (result) {
OppRecords = result;
},
function (error) {
alert("[Could not get the data] - Error Message : " + error.message);
},
false, null
);

Here are 2 examples of the json:

    • @odata.etag:"W/"1079634"",
    • accountnumber:"AF3HN2S4",
    • name:"A. Datum",
    • telephone1:"+86-23-4444-0100",
    • accountid:"475b158c-541c-e511-80d3-3863bb347ba8"
    },
  • {
    • @odata.etag:"W/"1007819"",
    • accountnumber:"ABSS4G45",
    • name:"Adventure Works",
    • telephone1:"+27-264-1234567",
    • accountid:"a8a19cdd-88df-e311-b8e5-6c3be5a8b200"

      Is there any way to query the metadata (the display name, the type of the fields) in the same query and have them in the corresponding object of the json received? If so, how will i query it?

      Or will i have to do two different queries and then try to put everything together?


      Thank you very much for your patience!

*This post is locked for comments

  • Suggested answer
    Siddique mahsud Profile Picture
    11 on at
    RE: Querying metadata and data values

    You cannot get entity data/records and meta data in single odata call, you need a seperate odata web Api call for metadata.

    You can check below link for retrieving meta data.

    docs.microsoft.com/.../retrieve-metadata-name-metadataid

    Thanks

  • Verified answer
    jlattimer Profile Picture
    24,558 on at
    RE: Querying metadata and data values

    You'd need 2 separate Web API operations or combine the 2 operations in an Action/plug-in and and then have 1 Web API call.

    Metadata isn't stored like an entity so you wouldn't naively be able to do a join.

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,884 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,758 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans