Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

View with aggregate function

$
0
0

I am trying to develop a view for a list of courses that also shows a sum on the number of participants booked across all bookings - below is a copy of of the saved query xml for the entity. 

Whenever I try to display the view I get a generic error message

Any help would be very much appreciated!!

<savedquery>

            <IsCustomizable>1</IsCustomizable>

            <CanBeDeleted>0</CanBeDeleted>

            <isquickfindquery>0</isquickfindquery>

            <isprivate>0</isprivate>

            <isdefault>0</isdefault>

            <returnedtypecode>10018</returnedtypecode>

            <savedqueryid>{526eaa94-06f9-41fc-b575-6be319863651}</savedqueryid>

            <layoutxml>

              <grid name="resultset" object="10018" jump="subject" select="1" icon="1" preview="1">

                <row name="result" id="activityid">

                  <cell name="subject" width="300" />

                  <cell name="statuscode" width="100" />

                  <cell name="new_course" width="100" />

                  <cell name="ownerid" width="100" />

                  <cell name="new_coursebooking.new_participantsbooked" width="100" />

                </row>

              </grid>

            </layoutxml>

            <querytype>0</querytype>

            <fetchxml>

 <fetch version="1.0" mapping="logical" distinct="false" aggregate="true">

<entity name="new_courseinstance">

<attribute name="subject" groupby="true" alias="subject" />

<attribute name="statuscode" groupby="true" alias="statuscode" />

<attribute name="ownerid" groupby="true" alias="ownerid" />

<attribute name="new_course" groupby="true" alias="new_course" />

<attribute name="activityid" groupby="true" alias="activityid1" />                 

<link-entity name="new_coursebooking" from="new_course" to="activityid" alias="new_coursebooking1" link-type="outer">

<attribute name="new_participantsbooked" aggregate="sum" alias="bookingsum" />

</link-entity>

<order alias="subject" descending="false" />

<filter type="and">

<condition attribute="statecode" operator="not-null" />

</filter>

</entity>

 </fetch>

            </fetchxml>

            <LocalizedNames>

              <LocalizedName description="All Courses" languagecode="1033" />

            </LocalizedNames>

          </savedquery>


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>