Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Get second entity results from a Xrmquery when using fetchxml

(0) ShareShare
ReportReport
Posted on by 509

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,325 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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans