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)

Record count next to entity name in left side bar

(0) ShareShare
ReportReport
Posted on by 85

I'm looking at CRM 2011 on premise and want to display the record count for each entity in the sidebar. 

For example in the Account form under Sales I'd like to see

Opportunities (20)

Quotes (5)

Orders (3)

I found this article

http://crmxpg.nl/wp/2010/09/22/show-number-of-related-activitieshistory-for-a-record-part-2/

but had problems getting the code to work (it was written for CRM 4.0).

 

This is a feature currently in Salesforce.

 

Thanks

*This post is locked for comments

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

    Here is something quick I came up with as an example. From an Account record it will show the number of open Opportunities in the left hand navigation. Basically what I did was create an oData query to find the result set I wanted the count on, and appended the count of the results to the corresponding menu item. You'll need jQuery as a Web Resource for this to work. Check out the CRM 2011 OData Query Designer on CodePlex for a useful tool to help build the oData queries. 

    function GetOpenOpportunityCount() {
        var guid = Xrm.Page.data.entity.getId();
        var urlSelect = "http://YOURSERVER/YOURORG/xrmservices/2011/OrganizationData.svc/OpportunitySet?$filter=AccountId/Id eq guid'"
            + guid + "' and StateCode/Value eq 0";
        $.ajax({
            type: "GET",
            contentType: "application/json; charset=utf-8",
            datatype: "json",
            url: urlSelect,
            beforeSend: function (XMLHttpRequest) { XMLHttpRequest.setRequestHeader("Accept", "application/json"); },
            success: function (data, textStatus, XmlHttpRequest) {
                $("#navOpps").children(".ms-crm-Nav-Subarea-Title").append(" (" + data.d.results.length + ")");
            },
            error: function (XmlHttpRequest, textStatus, errorThrown) {
                alert('Error');
            }
        });
    }
    

     

  • michaell1999 Profile Picture
    85 on at

    Thanks, that worked.

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