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

I have the same question (0)
  • Verified answer
    jlattimer Profile Picture
    24,562 on at

    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.

  • Suggested answer
    Siddique mahsud Profile Picture
    11 on at

    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

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans