web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

[SDK] Multiple entity chart

(0) ShareShare
ReportReport
Posted on by

Hi everyone,

I'm basing my question on an article on CRM Chart guy.

I have 4 entities : Ticket, Incident, Evolution, Project.

I'm trying to create a chart that shows the number of Tickets, Incident, Evolution according to the name of the Project.
There is a 1-N between Project and Tickets, Tickets and Incident, Tickets and Evolution.

I've created a chart in the entity Project, exported my solution and went sowly 'one bar at a time'.

I've only changed the datadefinition tag that became this :

<datadescription>
	<datadefinition>
	  <fetchcollection>
		<fetch mapping="logical" aggregate="true">
		  <entity name="tma_projet">
			<attribute groupby="true" alias="NameProject" name="tma_name" />
				<link-entity name="tma_ticket" from="tma_ticketid" to="tma_projetid" link-type="outer">
					<attribute groupby="true" alias="NumberOfTickets" name="tma_name" aggregate="countcolumn" />
				</link-entity>
			<attribute alias="_CRMAutoGen_aggregate_column_Num_13" name="tma_name" aggregate="countcolumn" />
			<attribute alias="_CRMAutoGen_aggregate_column_Num_14" name="tma_name" aggregate="countcolumn" />
		  </entity>
		</fetch>
	  </fetchcollection>
	  <categorycollection>
		<category alias="NameProject">
		  <measurecollection>
			<measure alias="NumberOfTickets" />
		  </measurecollection>
		  <measurecollection>
			<measure alias="_CRMAutoGen_aggregate_column_Num_13" />
		  </measurecollection>
		  <measurecollection>
			<measure alias="_CRMAutoGen_aggregate_column_Num_14" />
		  </measurecollection>
		</category>
	  </categorycollection>
	</datadefinition>
</datadescription>

When importing the solution again, the system tells me there is an error, and that i should ask the Community ><...

Any idea what's wrong ?

(I'm using a on-premise 7.0 version of Microsoft Dynamics CRM 2015)

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: [SDK] Multiple entity chart

    Up for questionning. =)

  • Verified answer
    ThomasN Profile Picture
    3,190 on at
    RE: [SDK] Multiple entity chart

    Hi Caroline, Thank you for reaching out. I have used several tips from the Chart Guy and they were all awesome. If you are importing this chart as part of a solution there is an error that appears.

    Try importing just the chart itself to the entity under "Customize the System". This should work for you. Easiest would be to export only the chart not the solution. Then make your edits and import the chart under charts for the Project entity.

    Let us know how that works. Have a wonderful day!

    -Tom

  • Community Member Profile Picture
    on at
    RE: [SDK] Multiple entity chart

    Thank you for the discovery !

    It is saying now that "the specified field does not exist in Microsoft Dynamics CRM".

    All are custom entities, so they don't really exist normally in MSCRM, but they do in my solution.

    As a reminder here is the code :

    <datadescription>
        <datadefinition>
          <fetchcollection>
            <fetch mapping="logical" aggregate="true">
              <entity name="tma_projet">
                <attribute groupby="true" alias="_CRMAutoGen_groupby_column_Num_0" name="tma_projetid" />
    			<link-entity name="tma_ticket" from="tma_projetid" to="tma_ticketid">
    				<attribute alias="NbTicket" name="tma_ticketid" aggregate="countcolumn" />
    			</link-entity>
    
                <attribute alias="_CRMAutoGen_aggregate_column_Num_13" name="tma_projetid" aggregate="count" />
                <attribute alias="_CRMAutoGen_aggregate_column_Num_14" name="tma_projetid" aggregate="count" />
              </entity>
            </fetch>
          </fetchcollection>
          <categorycollection>
            <category alias="_CRMAutoGen_groupby_column_Num_0">
              <measurecollection>
                <measure alias="NbTicket" />
              </measurecollection>
              <measurecollection>
                <measure alias="_CRMAutoGen_aggregate_column_Num_13" />
              </measurecollection>
              <measurecollection>
                <measure alias="_CRMAutoGen_aggregate_column_Num_14" />
              </measurecollection>
            </category>
          </categorycollection>
        </datadefinition>
      </datadescription>


    tma_projet is the name of the entity Project.

    tma_ticket is the name of the entity Ticket

    There is a 1:N relationship between Project and Ticket, which relationship field is tma_projetid which exists in the Ticket fields list.

    tma_projetid is also the primary key of the Project entity
    tma_ticketid is the primary key of the Ticket entity.

    So what am I doing wrong ?

  • Verified answer
    ThomasN Profile Picture
    3,190 on at
    RE: [SDK] Multiple entity chart

    Hi Caroline,

    The only thing I see is the spelling of tma_projet is missing a 'c' if I is intended to be project. However, it may have been misspelled on creation and the schema name is that exactly.

    When dealing with these fetch statements the easiest way to create them is to use advanced find. From advanced find add the columns you are looking for in this dashboard, just for the tma_projet entity. Then instead of looking at results, click "Download Fetch XML". This will give you the structure and schema names for the fields you are looking at. Which can surprise us sometimes.

    Let me know how that works. Have a great day!

    -Tom

    advancedfind_5F00_downloadXML.PNG

  • Community Member Profile Picture
    on at
    RE: [SDK] Multiple entity chart

    Hi Tom,

    I used FetchXML Tester on XrmToolBox, and it was much more explicit. I therefore understood that on the first link-entity tag, the "to" attribute value must be a field of the project entity and not of the ticket one.

    The documentation was so poor on this, that I will copy this link that helped me a little to understand FetchXML (i'm more of a SQL user normally =D ) msdn.microsoft.com/.../gg328117.aspx

    I will also give this link mostlymscrm.blogspot.fr/.../entity-statecodes-and-statuscodes.html for filter code as i went looking for them when building my fetchXml request...

    It might help the future people passing by.

    THANK you like a loooot for your help.

    It worked and my multi-entity chart is beautifully shown on my dashboard thanks to your little trick of importing only the chart and not the whole solution.

  • ThomasN Profile Picture
    3,190 on at
    RE: [SDK] Multiple entity chart

    Yay, I am glad to help. Those links above are good ones, I am saving them myself for future use. Have a great day!

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans