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)

how to find entity resides to which Module in crm

(0) ShareShare
ReportReport
Posted on by 605

Hi all,

I wanted to know how to find entity resides in which Module in crm. (progamatically)

Example: "Accounts" entity resides to which module ?

 I need to develop a code which tells me "Accounts" entity resides in Sales/Service module!

Thanks

*This post is locked for comments

I have the same question (0)
  • Tristan Profile Picture
    161 on at

    You could use the sdk to download the SiteMap.xml file and then use XPath to query it to find out the Area under which the entity sits, some entities will appear under multiple areas unless you have edited the default Site Map.

    Thanks,

    Tristan

  • Rahul G J Profile Picture
    605 on at

    Is there any code example that i can see how its done ?

  • Tristan Profile Picture
    161 on at

    This code should allow you to download the Site Map:

                       var qe = new QueryExpression("sitemap");

                       qe.ColumnSet = new ColumnSet(true);

                       EntityCollection ec = Service.RetrieveMultiple(qe);

                       siteMap = ec[0];

                       siteMapDoc = new XmlDocument();

                       siteMapDoc.LoadXml(ec[0]["sitemapxml"].ToString());

    It's from the XRM Toolkit Site Map Editor code.

    This is a great tool for building XPath queries: www.whitebeam.org/.../xpathtestbed.rhtm

    Thanks,

    Tristan

  • Rahul G J Profile Picture
    605 on at

    This was a great post, but i unable to build xpath which tells me "Accounts" entity resides in Sales/Service module!

    Thanks

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi,

    In that case you need to retrieve entity metadata, please refer the below link :

    crmprof.wordpress.com/.../how-to-retrieve-entity-metadata-using-net-in-microsoft-dynamics-crm-2011

  • Verified answer
    Tristan Profile Picture
    161 on at

    Have a search on google for find nodes with specific child nodes, this StackOverflow answer has what you need:
    http://stackoverflow.com/questions/10881179/xpath-find-all-elements-with-specific-child-node

    Essentially you're after Group nodes with SubArea nodes where the Entity attribute equals your value.

    Thanks,

    Tristan

  • Rahul G J Profile Picture
    605 on at

    Thanks Tristan! indeed you gave me a very good solution!

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