20 Mayıs 2012 Pazar 17:23
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'>
<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' />
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 :-)
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.
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"