Quantcast
Channel: Microsoft Dynamics CRM
Viewing all articles
Browse latest Browse all 137182

Forum Post: Dynamic Grouping with Fetchxml

$
0
0

Hi All

I was wondering whether it is possible use  group by in fetchxml using a parameter ie: if the user selects account then the accountname field has groupby ='true' but if they select competitor (in the linked entity) then it has the groupby = 'true' (see fetchxml below)

<fetch mapping="logical">

 <entity name="Opportunity">

   <attribute name="name" />

   <attribute name="accountidname" />

   <attribute name="statecodename" />

   <attribute name="statuscodename" />

   <attribute name="actualclosedate" />

   <attribute name="estimatedvalue" />

   <link-entity name="OpportunityCompetitors" to="opportunityid" from="opportunityid" alias="co" link-type="outer">

     <link-entity name="Competitor" to="competitorid" from="competitorid" alias="c" link-type="inner">

       <attribute name="name" />

     </link-entity>

   </link-entity>

<filter type='and'>

           <condition attribute='statecode' operator='in' value='@oppStatus'>

  <condition attribute="actualclosedate" operator="on-or-after" value="@startDate" /> <!-- need to cast the parameter to yyyy-mm-dd?-->

  <condition attribute="actualclosedate" operator="on-or-before" value="@endDate" />  

      </filter>

 </entity>

</fetch>

Is this possible to do natively (ie: groupby = '@groupby') or do I have create a webservice to include this logic?

Regards

Charles


Viewing all articles
Browse latest Browse all 137182

Trending Articles



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