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