No results using Fetch XML Query
-
Hi,
I cannot really figure out how to use the fetch xml query tag in the twig templates, quite new to everything related to WordPress, so it can be just me misunderstanding the documentation, but I cannot get my head around it.
Anyhow, I have connected the plugin to the CRM and when a try to list accounts using the view tag like the example below everything works great:
[msdyncrm_twig] {% view entity="account" name="Active Accounts" count="10" cache="PT30M" %} <h3>DATA - list the fetched records</h3> <div> {% for c in entityview.records %} <li>{{ c.name }} - {{c.modifiedon}}</li> {% endfor %} </div> {% endview %} [/msdyncrm_twig]But when I try to do the same thing using the fetch xml tag I get no results, nothing is rendered, as far a I can tell the variable
accountsin the example below does not even exist. The xml I just downloaded from the advanced search dialog in Dynamics after selecting the same view as in te example above (“Active accounts”)[msdyncrm_twig] {% fetchxml collection="accounts" %} <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"> <entity name="account"> <attribute name="name" /> <attribute name="new_companyname" /> <attribute name="primarycontactid" /> <attribute name="modifiedon" /> <attribute name="new_syncstate" /> <attribute name="new_recordid" /> <attribute name="accountnumber" /> <attribute name="accountid" /> <order descending="true" attribute="modifiedon" /> <filter type="and"> <condition attribute="statecode" operator="eq" value="0" /> </filter> <link-entity name="contact" from="contactid" to="primarycontactid" visible="false" link-type="outer" alias="a_410707b195544cd984376608b1802904"> <attribute name="emailaddress1" /> <attribute name="telephone1" /> </link-entity> </entity> </fetch> {% endfetchxml %} <div> <h3>RESULTS:</h3> <p>error?: {{accounts.error}}</p> <ul> {% for a in accounts.results.entities %} <li>{{a.name}}</li> {% endfor %} </ul> </div> [/msdyncrm_twig]Am I missing something in the syntax here? Or what to look for? Or what to try, anyone have any hints?
//Andreas
The topic ‘No results using Fetch XML Query’ is closed to new replies.