dynamics crm - How to implement custom FetchXML with aggregate as a System View in Dynamics365 -
i have custom entity called course enrolment has lookup contact entity.
want view of contacts have active course enrolment.
i don't believe can done contact entity, have create view of active course enrolments displays contact fields.
doing give me duplicate contacts if have more 1 course enrolment not want.
to avoid this, tried creating aggregate query in fetchxml:
<fetch version="1.0" aggregate="true" > <entity name="flr_courseenrolment" > <link-entity name="contact" from="contactid" to="flr_contact" alias="a_69c0f6b80d94e711812ae0071b66a541" > <attribute name="emailaddress1" alias="contactemailaddress1" groupby="true" /> <attribute name="fullname" alias="contactfullname" groupby="true" /> <filter type="and" > <condition attribute="statecode" operator="eq" value="0" /> <condition attribute="flr_islearner" operator="eq" value="1" /> <condition attribute="flr_advisor" operator="eq" uiname="test user" uitype="systemuser" value="{28c0d53b-5e19-e611-8106-c5346cc262d1}" /> </filter> </link-entity> <attribute name="flr_courseenrolmentid" alias="aggregateflr_enrolmentid" groupby="true" /> </entity> </fetch>
this query works in xrm toolbox fetchxml tester. not work when import crm.
i importing crm exporting solution containing view contains same fields; , replacing fetchxml generated system fetchxml created, , re-importing it.
i receive generic crm error when trying view view after importing again says "columns should specified on retrieve multiple."
<organizationservicefault xmlns:i="http://www.w3.org/2001/xmlschema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/contracts"> <activityid>b3b1d783-a8be-4454-9ed5-b71c42053299</activityid> <errorcode>-2147220970</errorcode> <errordetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/system.collections.generic" /> <message>system.xml.xmlexception: microsoft dynamics crm has experienced error. reference number administrators or support: #2955adde</message> <timestamp>2017-09-11t03:22:55.50674z</timestamp> <exceptionretriable>false</exceptionretriable> <exceptionsource i:nil="true" /> <innerfault> <activityid>b3b1d783-a8be-4454-9ed5-b71c42053299</activityid> <errorcode>-2147220970</errorcode> <errordetails xmlns:d3p1="http://schemas.datacontract.org/2004/07/system.collections.generic" /> <message>columns should specified on retrievemultiple.</message> <timestamp>2017-09-11t03:22:55.50674z</timestamp> <exceptionretriable>false</exceptionretriable> <exceptionsource i:nil="true" /> <innerfault> <activityid>b3b1d783-a8be-4454-9ed5-b71c42053299</activityid> <errorcode>-2147220970</errorcode> <errordetails xmlns:d4p1="http://schemas.datacontract.org/2004/07/system.collections.generic" /> <message>system.invalidoperationexception: microsoft dynamics crm has experienced error. reference number administrators or support: #f043ab2e</message> <timestamp>2017-09-11t03:22:55.50674z</timestamp> <exceptionretriable>false</exceptionretriable> <exceptionsource i:nil="true" /> <innerfault i:nil="true" /> <originalexception i:nil="true" /> <tracetext i:nil="true" /> </innerfault> <originalexception i:nil="true" /> <tracetext i:nil="true" /> </innerfault> <originalexception i:nil="true" /> <tracetext i:nil="true" /> </organizationservicefault>
i have feeling either:
- the alias on flr_courseenrolmentid causing view break
- aggregate/groupby not supported @ in crm views
- i need customise layoutxml in way fetchxml
is want achieve possible? there way display fetchxml in view in crm, or there way achieve view need?
create view under contact.
as conditions, pick related entity "course enrollment (contact)" (i'm assuming name here) , conditions put "contact contains data" , "status equals active".
this same fetching accounts active contacts.
Comments
Post a Comment