How to display Opportunity-Count on Account view
-
20 Mayıs 2012 Pazar 17:23
Hi,
In the CRM 2011 SDK, I found the way to 'WorkWithViews', where we can add a custom view with a .Net program. So I tried to create a view that uses the following FetchXML to display the aggregate field for OpportunityCount in the Account entity view: -
<fetch mapping='logical' aggregate='true'>
<entity name='account'>
<attribute name='name' alias='Account' groupby='true' />
<link-entity name='opportunity' alias='Oppty' from='customerid' to='accountid' link-type='outer'>
<attribute name='name' alias='OpptyCount' aggregate='countcolumn' />
</link-entity>
</entity>
</fetch>The FetchXML works fine in the FetchXML-Query-Designer, but when used in the .Net program, gives error on the layoutXml of SavedQuery.
If anyone has achieved this, kindly share the .Net code part that builds the layoutXml and fetchXml for the SavedQuery
Thanks in advance :-)
\Ajay\Ajay
Tüm Yanıtlar
-
21 Mayıs 2012 Pazartesi 01:20
Though we can add custom views programmatically views do not support including fetch xml with aggregate functions included. Layout xml part of the savedquery deals with the view column layout in which the results of the fetchxml be displayed.
You can retrieve one of the existing saved queries using retrieve multiple message and read and design a similar layout xml for your view.
HTH
Sam
Dynamics CRM MVP | Inogic | http://inogic.blogspot.com| news at inogic dot com
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"
- Yanıt Olarak Öneren Sam - InogicMVP 21 Mayıs 2012 Pazartesi 01:20
- Yanıt Olarak İşaretleyen ajayubbott 21 Mayıs 2012 Pazartesi 03:30