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)

Help with XML code to chart 2 entities on a single chart

(0) ShareShare
ReportReport
Posted on by 100

Hi everyone - I'm trying to chart 2 entities on a single chart and need some help.  The goal is to show YTD GM (a sum of multiple records in my activeprograms entity) side-by-side with that users' GM target (a field called new_2017gmtarget in my user entity).  I've tried to follow the guidance of CRM Chart Guy (https://crmchartguy.wordpress.com/2014/02/24/multiple-entities-in-one-ms-crm-chart/) on how to get the 2 entities in the chart but am having trouble with my code re-importing.  Error: The specified record does not exist.  Can someone look at my XML please?

<visualization>
  <visualizationid>{034B3A10-BC30-E711-8128-70106FA9E1E1}</visualizationid>
  <name>2017 YTD Realized GM</name>
  <primaryentitytypecode>activeprograms</primaryentitytypecode>
  <datadescription>
    <datadefinition>
      <fetchcollection>
        <fetch mapping="logical" aggregate="true">
          <entity name="activeprograms">
            <attribute name="ownerid" groupby="true" alias="_CRMAutoGen_groupby_column_Num_0" />
            <link-entity name="user" from="ownerid" to="systemuserid" link-type="outer">
	<link-entity name="user" from="ownerid" to="systemuserid" link-type="outer">
		<attribute alias="GMTarget" name="new_2017gmtarget_base" aggregate="sum" distinct="true" />
		<filter type="and">
		  <condition attribute="statecode" operator="eq" value="0" />
		</filter>
	</link-entity>
</link-entity>
            <attribute name="new_total2017gm_base" aggregate="sum" alias="_CRMAutoGen_aggregate_column_Num_13" />
          </entity>
        </fetch>
      </fetchcollection>
      <categorycollection>
        <category alias="_CRMAutoGen_groupby_column_Num_0">
          <measurecollection>
            <measure alias="GMTarget" />
          </measurecollection>
          <measurecollection>
            <measure alias="_CRMAutoGen_aggregate_column_Num_13" />
          </measurecollection>
        </category>
      </categorycollection>
    </datadefinition>
  </datadescription>
  <presentationdescription>

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Gopalan Bhuvanesh Profile Picture
    11,401 on at

    Link entity should be systemuser instead of user and try again.

  • plesq Profile Picture
    100 on at

    Thanks :) That's the same link I have in my post and have been using for guidance.  The problem is with my actual code - I 'm doing something wrong as I cant import it back.

  • Gopalan Bhuvanesh Profile Picture
    11,401 on at

    corrected

  • plesq Profile Picture
    100 on at

    I changed user to systemuser and still getting the same error (the entity name is user I think no?)

    Do you spot any other typos?

  • Suggested answer
    Gopalan Bhuvanesh Profile Picture
    11,401 on at

    Hi

    I have corrected only the entity and field names only. According to your logic, please modify the links and attributes.

    new_2017gmtarget_base is not in User so move to the right entity

    <fetch mapping="logical" aggregate="true">
              <entity name="account">
                <attribute name="ownerid" groupby="true" alias="_CRMAutoGen_groupby_column_Num_0" />
                <link-entity name="systemuser" from="systemuserid" to="ownerid" link-type="outer">
                  <link-entity name="systemuser" from="systemuserid" to="systemuserid" link-type="outer">
                    <!--attribute alias="GMTarget" name="new_2017gmtarget_base" aggregate="sum" distinct="true" /-->
                    <filter type="and">
                      <condition attribute="isdisabled" operator="eq" value="0" />
                    </filter>
                  </link-entity>
                </link-entity>
                <attribute name="new_total2017gm_base" aggregate="sum" alias="_CRMAutoGen_aggregate_column_Num_13" />
              </entity>
            </fetch>
    


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