dependabot[bot] on nuget
dependabot[bot] on nuget
Bump MscrmTools.Xrm.Connection … (compare)
dependabot[bot] on nuget
Bump Microsoft.CrmSdk.XrmToolin… (compare)
dependabot[bot] on nuget
Bump Microsoft.CrmSdk.XrmToolin… (compare)
dependabot[bot] on nuget
Bump Microsoft.CrmSdk.XrmToolin… (compare)
dependabot[bot] on nuget
<fetch>
<entity name='opportunity' >
<attribute name='name' />
<link-entity name='account' from='accountid' to='customerid' alias='A' >
<attribute name='telephone1' />
<link-entity name='systemuser' from='systemuserid' to='owninguser' alias='O' >
<attribute name='internalemailaddress' />
</link-entity>
</link-entity>
</entity>
</fetch>
<fetch>
<entity name='account' >
<attribute name='name' />
<filter type='and' >
<condition entityname='C1' attribute='statuscode' operator='neq' value='1' />
<filter type='or' >
<condition entityname='C2' attribute='contactid' operator='null' />
<condition entityname='C2' attribute='statuscode' operator='neq' value='1' />
</filter>
</filter>
<link-entity name='contact' from='contactid' to='new_contactid1' link-type='inner' alias='C1' />
<link-entity name='contact' from='contactid' to='new_contactid2' link-type='outer' alias='C2' />
</entity>
</fetch>
Hi Jonas,
Running version 1.2018.2.2 and I have this query, but the QueryBuilder has trouble understanding the rowaggregate attribute. Maybe a fix in a future version?
´´´
<fetch distinct="false" no-lock="false" mapping="logical" page="1" count="250" returntotalrecordcount="true" >
<entity name="account" >
<attribute name="name" />
<attribute name="address1_city" />
<attribute name="primarycontactid" />
<attribute name="telephone1" />
<attribute name="accountid" />
<attribute name="processid" />
<attribute name="name" />
<attribute name="telephone1" />
<attribute name="address1_city" />
<attribute name="primarycontactid" />
<attribute name="parentaccountid" alias="HierarchyDataParentID6dcd9e4c001441b09237d51a34853d55" />
<attribute name="accountid" alias="HierarchyDataChildCount6dcd9e4c001441b09237d51a34853d55" rowaggregate="CountChildren" />
<filter type="and" >
<condition attribute="ownerid" operator="eq-userid" />
<condition attribute="statecode" operator="eq" value="0" />
</filter>
<order attribute="name" descending="false" />
<link-entity name="contact" to="primarycontactid" from="contactid" link-type="outer" alias="accountprimarycontactidcontactcontactid" >
<attribute name="emailaddress1" />
</link-entity>
<link-entity name="workflow" to="processid" from="workflowid" link-type="outer" alias="processidworkflowworkflowid" >
<attribute name="versionnumber" />
</link-entity>
</entity>
</fetch>
´´´
If you run this query it actually executes, so the innards of CRM has support for the RowAggregate on the attribute node.
More precisely the fetch was taken from an out-of-the-box "Active Accounts" view.
<fetch version='1.0' output-format='xml-platform' mapping='logical' >
<entity name='account' >
<attribute name='name' />
<attribute name='address1_city' />
<order attribute='name' descending='false' />
<attribute name='primarycontactid' />
<attribute name='telephone1' />
<filter type='and' >
<condition attribute='statecode' operator='eq' value='0' />
</filter>
<link-entity alias='accountprimarycontactidcontactcontactid' name='contact' from='contactid' to='primarycontactid' link-type='outer' visible='false' >
<attribute name='emailaddress1' />
</link-entity>
<attribute name='accountid' />
</entity>
</fetch>
(Sorry about the delay, I'm currently at eXtreme365 in Dubrovnik)
The FetchType
object is created from the FetchXML in this method: https://github.com/Innofactor/FetchXMLBuilder/blob/master/FetchXmlBuilder/DockControls/TreeBuilderControl.cs#L202-L212
The FetchType
class is generated from the fetch.xsd
schema file provided by Microsoft: https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/org-service/fetchxml-schema
I use this cmd file to generate the class from the schema: https://github.com/Innofactor/FetchXMLBuilder/blob/master/FetchXmlBuilder/Resources/XSD%20fetch.cs.cmd
Hope this helps!
In this fetch, the UI complains that "entityname" is invalid in the condition which I believe I see in the example given. Haven't gotten much past that. I see that my filters may need work, but this syntax issues has me stumped
<fetch mapping="logical" version="1.0" distinct="true" output-format="xml-platform" >
<entity name="contact" >
<attribute name="fullname" />
<attribute name="xyz_studentid" />
<attribute name="contactid" />
<filter type="and" >
<condition value="0" attribute="statecode" operator="eq" />
<condition value="1" attribute="xyz_isstudent" operator="eq" />
</filter>
<link-entity name="xyz_enrollment" to="contactid" from="xyz_student" alias="Fut" link-type="outer" />
<link-entity name="xyz_enrollment" to="contactid" from="xyz_student" alias="Prev" >
<filter type="or" >
<filter type="and" >
<condition entityname="Prev" attribute="xyz_code" operator="in" >
<value>{E165DCFC-785B-E711-8119-E0071B669EB1}</value>
<value>{E065DCFC-785B-E711-8119-E0071B669EB1}</value>
</condition>
<condition entityname="Prev" value="802430000" attribute="xyz_enrollmentstatus" operator="eq" />
</filter>
<filter type="and" >
<condition entityname="Fit" attribute="xyz_code" operator="in" >
<value>{EA65DCFC-785B-E711-8119-E0071B669EB1}</value>
<value>{E865DCFC-785B-E711-8119-E0071B669EB1}</value>
<value>{E665DCFC-785B-E711-8119-E0071B669EB1}</value>
<value>{E365DCFC-785B-E711-8119-E0071B669EB1}</value>
</condition>
<condition entityname="Fut" value="802430000" attribute="xyz_enrollmentstatus" operator="eq" />
</filter>
</filter>
</link-entity>
</entity>
</fetch>