web
You’re offline. This is a read only version of the page.
close
Skip to main content
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

I have the same question (0)
  • 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,562 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#2
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans