Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Suggested answer

Get second entity results from a Xrmquery when using fetchxml

Posted on by 507

Hi

I'm working on something where I'm using Xrmquery.retrievemultiple to get information from multiple entities.

I require not only information from the base entity, I require the information from a second entity too.

However I'm only able to output from the original entity (crm_sestemplate).

Is it possible to retrieve the information I require?

I need both versions of the crm_place, and the crm_bookable

var fetch = '<fetch>';
fetch += '<entity name="crm_sestemplate" >';
fetch += '<attribute name="crm_name" />';
fetch += '<attribute name="crm_place" />';
fetch += '<link-entity name = "crm_seschannel" from = "crm_sessiontemplateid" to = "crm_sessiontemplateid" visible = "false" intersect = "true" alias = "a1">'
fetch += '<link-entity name = "crm_assesslconfig" from = "crm_assesslconfigid" to = "crm_assesslconfigid" >';
fetch += '<attribute name="crm_place" />'
fetch += '<attribute name="crm_bookable" />'
fetch += '</link-entity>'
fetch += '</link-entity>';
fetch += '</entity>';
fetch += '</fetch>';

XrmQuery.retrieveMultiple(x => x.crm_sestemplates).useFetchXml(fetch).execute((fetchResult) => {
if (fetchResult && fetchResult.length > 0) {

console.log("fetchResult[0].crm_venue_guid: " + fetchResult[0].crm_place_guid);
console.log("fetchResult[0].crm_name: " + fetchResult[0].crm_name);

} else {
console.log("no fetch result");
}
});

}

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,321 Most Valuable Professional on at
    RE: Get second entity results from a Xrmquery when using fetchxml

    Hello,

    XrmQuery has GitHub repo, wiki and issues section there - github.com/.../XrmQuery-Web-API

    I would recommend asking the author of the tool how it works.

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,558 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,645 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans